diff --git a/README.md b/README.md index bc90ed2..42bc0fb 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ Chrome 应用商店: +点击展开/折叠内容 2024.07.21 不兼容更新,已匹配 v0.22.3 2024.06.15 感谢好心人 [PR#44](https://github.com/lmm214/memos-bber/pull/44) @@ -58,3 +62,4 @@ Chrome 应用商店: \ No newline at end of file diff --git a/js/oper.js b/js/oper.js index 14e4d2f..79c2e44 100644 --- a/js/oper.js +++ b/js/oper.js @@ -181,7 +181,7 @@ function uploadImageNow(base64String, file) { filename: new_name, type: file.type }; - var upAjaxUrl = info.apiUrl + 'api/v1/resources'; + var upAjaxUrl = info.apiUrl + 'api/v1/attachments'; $.ajax({ url: upAjaxUrl, data: JSON.stringify(data), @@ -247,8 +247,8 @@ $('#saveKey').click(function () { const settings = { async: true, crossDomain: true, - url: apiUrl + 'api/v1/auth/status', - method: 'POST', + url: apiUrl + 'api/v1/auth/me', + method: 'GET', headers: { 'Authorization': 'Bearer ' + apiTokens } @@ -256,9 +256,9 @@ $('#saveKey').click(function () { $.ajax(settings).done(function (response) { // 0.24 版本后无 id 字段,改为从 name 字段获取和判断认证是否成功 - if (response && response.name) { + if (response && response.user.name) { // 如果响应包含用户name "users/{id}",存储 apiUrl 和 apiTokens - var userid = parseInt(response.name.split('/').pop(), 10) + var userid = parseInt(response.user.name.split('/').pop(), 10) chrome.storage.sync.set( { apiUrl: apiUrl, @@ -298,7 +298,7 @@ $('#tags').click(function () { if (info.apiUrl) { var parent = `users/${info.userid}`; // 从最近的1000条memo中获取tags,因此不保证获取能全部的 - var tagUrl = info.apiUrl + 'api/v1/' + parent + '/memos?pageSize=1000'; + var tagUrl = info.apiUrl + 'api/v1/memos?pageSize=1000'; var tagDom = ""; $.ajax({ url: tagUrl, @@ -368,7 +368,7 @@ $('#search').click(function () { var searchDom = "" if(pattern){ $.ajax({ - url:info.apiUrl+"api/v1/"+parent+"/memos"+filter, + url:info.apiUrl+"api/v1/memos"+filter, type:"GET", contentType:"application/json", dataType:"json", @@ -429,7 +429,7 @@ $('#random').click(function () { var filter = "?filter=" + encodeURIComponent(`visibility in ["PUBLIC","PROTECTED"]`); if (info.status) { $("#randomlist").html('').hide() - var randomUrl = info.apiUrl + "api/v1/" +parent + "/memos" + filter; + var randomUrl = info.apiUrl + "api/v1/memos" + filter; $.ajax({ url:randomUrl, type:"GET", @@ -483,7 +483,7 @@ function randDom(randomData){ $(document).on("click","#random-link",function () { var memoUid = $("#random-link").data('uid'); get_info(function (info) { - chrome.tabs.create({url:info.apiUrl+"m/"+memoUid}) + chrome.tabs.create({url:info.apiUrl+"memos/"+memoUid}) }) }) @@ -679,4 +679,4 @@ function sendText() { }) } }) -} +} \ No newline at end of file diff --git a/manifest.json b/manifest.json index 0d0a277..2fe8634 100644 --- a/manifest.json +++ b/manifest.json @@ -2,14 +2,14 @@ "manifest_version": 3, "name": "__MSG_extName__", "default_locale": "en", - "version": "2025.03.29", + "version": "2026.02.22", "action": { "default_popup": "popup.html", "default_icon": "assets/logo_24x24.png", "default_title": "__MSG_actionTitle__" }, "description": "__MSG_extDescription__", - "homepage_url": "https://immmmm.com", + "homepage_url": "https://github.com/Jonnyan404/memos-bber", "icons": { "128": "assets/logo.png", "16": "assets/logo.png",