立项配置页初步优化

This commit is contained in:
Cheng Zhou
2026-02-24 16:53:22 +08:00
parent 0693f09b1d
commit 8f3f717e48
124 changed files with 12519 additions and 2954 deletions
+11 -1
View File
@@ -118,6 +118,7 @@ import { useAuthStore } from "../store/auth";
import { useStudyStore } from "../store/study";
import { getCachedCredential, setCachedCredential, clearCachedCredential } from "../utils/auth";
import { TEXT, requiredMessage } from "../locales";
import { consumeLogoutReason, LOGOUT_REASON_TIMEOUT } from "../session/sessionManager";
const auth = useAuthStore();
const router = useRouter();
@@ -143,6 +144,10 @@ let vantaEffect: any = null;
// 初始化 Vanta.js 效果
onMounted(() => {
const logoutReason = consumeLogoutReason();
if (logoutReason === LOGOUT_REASON_TIMEOUT) {
ElMessage.warning("长时间未操作,已自动退出登录,请重新登录");
}
const cached = getCachedCredential();
if (cached) {
form.email = cached.email;
@@ -228,8 +233,13 @@ const onSubmit = async () => {
router.push("/");
}
} catch (error: any) {
const status = error?.response?.status;
const detail = error?.response?.data?.detail || error?.response?.data?.message;
ElMessage.error(detail || TEXT.modules.auth.authFailed);
if (!status || status >= 500) {
ElMessage.error("服务暂时不可用,请稍后重试");
} else {
ElMessage.error(detail || TEXT.modules.auth.authFailed);
}
} finally {
loading.value = false;
}