diff --git a/app/server/public/index.html b/app/server/public/index.html
index c3fb852..3784496 100644
--- a/app/server/public/index.html
+++ b/app/server/public/index.html
@@ -1987,20 +1987,22 @@
setTitle('账户');
setActions('');
setBody('
');
+ // 单个 /api/me 即可判认证开关:启用认证时中间件保证已登录,user 必有;
+ // 未启用时 createAuth 提前返回,该路由不存在 → 404。无需再拉 /api/system/status
+ let me;
try {
- const [st, me] = await Promise.all([
- req('GET', '/api/system/status'),
- req('GET', '/api/me').catch(function () { return { user: null }; }), // 未启用认证时无此路由
- ]);
- if (!ctx()) return;
- if (!st.auth_enabled || !me || !me.user) {
- setBody('');
- return;
- }
- setBody('' + userCardHtml(me.user) + '
');
+ me = await req('GET', '/api/me');
} catch (e) {
- if (ctx()) setBody('');
+ if (ctx()) setBody('');
+ return;
}
+ if (!ctx()) return;
+ if (!me || !me.user) {
+ setBody('');
+ return;
+ }
+ setBody('' + userCardHtml(me.user) + '
');
}
async function changePassword() {
try {