fix: 管理导航不再先闪出用户再消失

This commit is contained in:
2026-11-06 14:35:03 +08:00
parent 1c20a9e85b
commit e2d932c85f
3 changed files with 25 additions and 7 deletions
+3
View File
@@ -5,6 +5,7 @@ import { HelpCircleOutline } from "@vicons/ionicons5";
import Shell from "../../shell/Shell.vue";
import { api } from "../../shared/http";
import { hosted } from "../../shared/installState";
import { rememberLoginMode } from "../../shared/loginMode";
import { useToast } from "../../shared/toast";
const toast = useToast();
@@ -41,6 +42,7 @@ async function load() {
try {
const result = await api<{ loginMode: string; credentialRefreshSeconds: number; workerConcurrency: number }>("/api/admin/settings");
mode.value = result.loginMode;
rememberLoginMode(result.loginMode);
seconds.value = result.credentialRefreshSeconds;
concurrency.value = result.workerConcurrency;
loaded.value = true;
@@ -57,6 +59,7 @@ async function save() {
method: "PUT",
body: JSON.stringify({ loginMode: mode.value, credentialRefreshSeconds: seconds.value, workerConcurrency: concurrency.value }),
});
rememberLoginMode(mode.value);
toast.success("已保存");
} catch (error) {
toast.error(error instanceof Error ? error.message : "保存失败");