fix: 管理导航不再先闪出用户再消失
This commit is contained in:
@@ -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 : "保存失败");
|
||||
|
||||
Reference in New Issue
Block a user