init.sql小bug修复-20260204

This commit is contained in:
Cheng Zhou
2026-02-04 16:17:51 +08:00
parent 737f84bf54
commit 0693f09b1d
4 changed files with 97 additions and 207 deletions
+12 -1
View File
@@ -115,6 +115,7 @@ import { reactive, ref, onMounted, onUnmounted } from "vue";
import { useRouter } from "vue-router";
import { ElMessage, type FormInstance, type FormRules } from "element-plus";
import { useAuthStore } from "../store/auth";
import { useStudyStore } from "../store/study";
import { getCachedCredential, setCachedCredential, clearCachedCredential } from "../utils/auth";
import { TEXT, requiredMessage } from "../locales";
@@ -215,7 +216,17 @@ const onSubmit = async () => {
} else {
clearCachedCredential();
}
router.push("/");
if (auth.user?.role === "ADMIN") {
const studyStore = useStudyStore();
await studyStore.ensureDefaultActiveStudy();
if (studyStore.currentStudy) {
router.push("/project/overview");
} else {
router.push("/admin/users");
}
} else {
router.push("/");
}
} catch (error: any) {
const detail = error?.response?.data?.detail || error?.response?.data?.message;
ElMessage.error(detail || TEXT.modules.auth.authFailed);