From 5f0567f13435cc54abccfb7b9798a7ab2e538721 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 22 Oct 2023 11:00:04 +0800 Subject: [PATCH] :iphone: fix https://github.com/siyuan-note/siyuan/issues/9448 --- app/src/mobile/settings/about.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/src/mobile/settings/about.ts b/app/src/mobile/settings/about.ts index 621d84b44..7b3a779bb 100644 --- a/app/src/mobile/settings/about.ts +++ b/app/src/mobile/settings/about.ts @@ -86,9 +86,10 @@ export const initAbout = () => {
${window.siyuan.languages.about13} - ${window.siyuan.config.api.token}
-
${window.siyuan.languages.about14}
@@ -233,7 +234,7 @@ export const initAbout = () => { event.preventDefault(); event.stopPropagation(); break; - } else if (target.id === "token") { + } else if (target.id === "tokenCopy") { showMessage(window.siyuan.languages.copied); writeText(window.siyuan.config.api.token); event.preventDefault(); @@ -360,6 +361,12 @@ export const initAbout = () => { exitSiYuan(); }); }); + const tokenElement = modelMainElement.querySelector("#token") as HTMLInputElement; + tokenElement.addEventListener("change", () => { + fetchPost("/api/system/setAPIToken", {token: tokenElement.value}, () => { + window.siyuan.config.api.token = tokenElement.value; + }); + }); } }); };