From 441a970e885a52fa8f741e0f2b69d754e296ea63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=BB=A11221?= Date: Thu, 18 Dec 2025 06:06:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Add:=20SharePoint=20SiteId=E5=9C=A8?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=86=85=E7=BD=AE?= =?UTF-8?q?uid=E5=92=8Ckey=E7=9A=84=E6=97=B6=E5=80=99=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 功能: 勾选`使用 OpenList 提供的参数`时,可在完成授权的情况下进行SiteID的读取 Signed-off-by: 小满1221 --- public/static/spoid.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/public/static/spoid.js b/public/static/spoid.js index 210f390..25fbcdb 100644 --- a/public/static/spoid.js +++ b/public/static/spoid.js @@ -64,7 +64,7 @@ function getWebdav() { // 获取站点ID -function getSiteID() { +function getSiteID(server_use_input = false) { const siteUrl = document.getElementById("sharepoint-url").value.trim(); const access_token = document.getElementById("access-token").value.trim(); const refresh_token = document.getElementById("refresh-token").value.trim(); @@ -91,12 +91,21 @@ function getSiteID() { BAD_REQUEST: "获取出现问题,请检查权限和站点URL,站点URL示例:https://demo.sharepoint.com/site/demo", DEFAULT: "请求发生错误" }; - - // 验证 - if (!client_uid || !client_key) { - idElement.value = ERROR_MESSAGES.MISSING_CREDENTIALS; + + // 使用服务器提供的uid和key获取站点ID + if (site_type.includes("onedrive")){ + if (!client_uid || !client_key){ + if (!server_use_input) { + idElement.value = ERROR_MESSAGES.MISSING_CREDENTIALS; + return; + } + } + }else{ + idElement.value = ERROR_MESSAGES.NOT_SUPPORTED; return; } + + // 验证 if (!access_token || !refresh_token) { idElement.value = ERROR_MESSAGES.MISSING_TOKENS; return; @@ -105,10 +114,6 @@ function getSiteID() { idElement.value = ERROR_MESSAGES.MISSING_URL; return; } - if (!site_type.includes("onedrive")) { - idElement.value = ERROR_MESSAGES.NOT_SUPPORTED; - return; - } if (!GATEWAYS[site_type]) { idElement.value = ERROR_MESSAGES.DEFAULT; return; @@ -168,4 +173,4 @@ function getSiteID() { idElement.value = ERROR_MESSAGES.BAD_REQUEST; console.error("URL解析失败:", error); } -} \ No newline at end of file +} From db7f63b857b9b63f24ddc77c364c538ee741d880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=BB=A11221?= Date: Thu, 18 Dec 2025 06:07:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=8E=B7=E5=8F=96SharePoint=20WebSite=20ID?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E4=BC=A0=E9=80=92=E5=8B=BE=E9=80=89?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `使用 OpenList 提供的参数` Signed-off-by: 小满1221 --- public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 49f4338..0d4facb 100644 --- a/public/index.html +++ b/public/index.html @@ -88,7 +88,7 @@

🔐 OpenList Token 获取工具

- +