人生啊人生 3 bulan lalu
induk
melakukan
e84204dfbc

+ 10 - 3
user_web/src/view/LogIn.vue

@@ -115,9 +115,16 @@ const onSubmit = (formEl: InstanceType<typeof ElForm> | undefined) => {
                     const userType = res.data.data.userType;
                     getCurrentUser().then((res) => {
                         userInfo.dataFill(Object.assign({ userType: userType }, res.data.data));
-                        // if (userType == 0) router.push({ path: '/train' });
-                        if (userType == 0) router.push({ path: '/studentMain' });
-                        else if (userType == 1) router.push({ path: '/TaskMng' });
+
+                        // // 老师,老接口的类型
+                        // if (userType == 0) router.push({ path: '/studentMain' });
+                        // // 学生,老接口的类型
+                        // else if (userType == 1) router.push({ path: '/TaskMng' });
+
+                        // 老师
+                        if (userType == 0) router.push({ path: '/TaskMng' });
+                        // 学生
+                        else if (userType == 1) router.push({ path: '/studentMain' });
                         else {
                             ElNotification({
                                 message: '无效用户',

+ 3 - 1
user_web/src/view/Manage.vue

@@ -35,7 +35,9 @@
         const userInfo = useUserInfo();
         userName.value = userInfo.nickName;
       
-        if (userInfo.userType != 1) {
+        // 判断是否是老师老接口是 1, 新接口是 0
+        // if (userInfo.userType != 1) {
+        if (userInfo.userType != 0) {
             router.push({
                 path: "/",
             });

+ 5 - 5
user_web/src/view/admin/components/User/LoginOrExit.vue

@@ -93,11 +93,11 @@ onMounted(function() {
     const userInfo = useUserInfo();
     userName.value = userInfo.nickName;
     
-    // if (userInfo.userType != 1) {
-    //     router.push({
-    //         path: "/",
-    //     });
-    // }
+    if (userInfo.userType != 0) {
+        router.push({
+            path: "/",
+        });
+    }
 });
 
 </script>

+ 4 - 1
user_web/src/view/student/layout/index.vue

@@ -42,7 +42,10 @@ const mainContainer = reactive({
 
 provide('mainContainer', mainContainer);
 onBeforeMount(() => {
-    if (userInfo.userType != 0) {
+
+    // 老接口 0 是学生,新接口 1 是学生
+    // if (userInfo.userType != 0) {
+    if (userInfo.userType != 1) {
         userInfo.removeToken();
         router.push({ path: '/' });
     }