From 793901d349d42e113b2783a0ccdf49e810f40ef7 Mon Sep 17 00:00:00 2001 From: Dream Hunter Date: Sun, 23 Nov 2025 23:31:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E8=AE=A4=E8=AF=81=E5=AF=86=E7=A0=81=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=20(#771)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: 修复自定义认证密码功能异常的问题 - 修复前端属性名错误 (openSettings.auth -> openSettings.needAuth) - 修复 /open_api/settings 接口被自定义认证拦截的问题 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude --- CHANGELOG.md | 4 ++++ frontend/src/api/index.js | 2 +- worker/src/worker.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9edd89c8..8611fac6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # CHANGE LOG +## v1.1.1(feature/email) + +- fix: 修复自定义认证密码功能异常的问题 (前端属性名错误 & /open_api 接口被拦截) + ## v1.1.0(main) - feat: |Admin| 维护页面增加清理 n 天前空邮件的邮箱地址功能 diff --git a/frontend/src/api/index.js b/frontend/src/api/index.js index 83cd8d29..3e419946 100644 --- a/frontend/src/api/index.js +++ b/frontend/src/api/index.js @@ -41,7 +41,7 @@ const apiFetch = async (path, options = {}) => { if (response.status === 401 && path.startsWith("/admin")) { showAdminAuth.value = true; } - if (response.status === 401 && openSettings.value.auth) { + if (response.status === 401 && openSettings.value.needAuth) { showAuth.value = true; } if (response.status >= 300) { diff --git a/worker/src/worker.ts b/worker/src/worker.ts index ea6b3a0a..2857e29f 100644 --- a/worker/src/worker.ts +++ b/worker/src/worker.ts @@ -52,7 +52,7 @@ app.use('/*', async (c, next) => { // check header x-custom-auth const passwords = getPasswords(c); - if (passwords && passwords.length > 0) { + if (!c.req.path.startsWith("/open_api") && passwords && passwords.length > 0) { const auth = c.req.raw.headers.get("x-custom-auth"); if (!auth || !passwords.includes(auth)) { return c.text(msgs.CustomAuthPasswordMsg, 401)