init.sql小bug修复-20260204
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user