人生啊人生 3 kuukautta sitten
vanhempi
säilyke
a67dd28088
1 muutettua tiedostoa jossa 9 lisäystä ja 4 poistoa
  1. 9 4
      user_web/src/view/LogIn.vue

+ 9 - 4
user_web/src/view/LogIn.vue

@@ -68,9 +68,14 @@ const rules = reactive({
                 if (!val) {
                     return callback();
                 }
-                if (!/^[a-zA-Z0-9_]{2,15}$/.test(val)) {
+                // if (!/^[a-zA-Z0-9_]{2,15}$/.test(val)) {
+                //     return callback(new Error('请输入正确的账户'));
+                // }
+
+                if (typeof val != 'string') {
                     return callback(new Error('请输入正确的账户'));
                 }
+                
                 return callback();
             },
             trigger: 'blur',
@@ -116,9 +121,9 @@ const onSubmit = (formEl: InstanceType<typeof ElForm> | undefined) => {
                     getCurrentUser().then((res) => {
                         userInfo.dataFill(Object.assign({ userType: userType }, res.data.data));
 
-                        // // 老师,老接口的类型
-                        // if (userType == 0) router.push({ path: '/studentMain' });
-                        // // 学生,老接口的类型
+                        // // 老接口的类型 - 学生
+                        // if (userType == 0) router.push({ path: '/train' });
+                        // // 老接口的类型 - 老师
                         // else if (userType == 1) router.push({ path: '/TaskMng' });
 
                         // 老师