Ver código fonte

pad端登录后调转页面

wangshuang 1 ano atrás
pai
commit
f4f4c4ac99
2 arquivos alterados com 27 adições e 15 exclusões
  1. 7 7
      inspur-ui/src/permission.js
  2. 20 8
      inspur-ui/src/views/login_pad.vue

+ 7 - 7
inspur-ui/src/permission.js

@@ -28,7 +28,7 @@ router.beforeEach((to, from, next) => {
         path: '/'
       })
       NProgress.done()
-    } else {
+    }else {
       if (store.getters.roles.length === 0) {
         isRelogin.show = true
         // 判断当前用户是否已拉取完user_info信息
@@ -65,12 +65,12 @@ router.beforeEach((to, from, next) => {
     } else {
       const userAgent = navigator.userAgent || navigator.vendor || window.opera;
       const isMOBILE = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent);
-      // if(isMOBILE){
-      //    next(`/login_pad`) // 否则全部重定向到登录页
-      // }else{
-      //    next(`/login`) // 否则全部重定向到登录页
-      // }
-      next(`/login`) // 否则全部重定向到登录页
+      if(isMOBILE){
+         next(`/login_pad`) // 否则全部重定向到登录页
+      }else{
+         next(`/login`) // 否则全部重定向到登录页
+      }
+      // next(`/login`) // 否则全部重定向到登录页
 
       NProgress.done()
     }

+ 20 - 8
inspur-ui/src/views/login_pad.vue

@@ -18,7 +18,7 @@
             <svg-icon slot="prefix" icon-class="login_password_pad" class="el-input__icon input-icon" />
           </el-input>
         </el-form-item>
-        <el-form-item prop="code" v-if="captchaOnOff" >
+        <el-form-item prop="code" v-if="captchaOnOff">
           <div class="display-row" style="margin-top:10px;">
             <el-input v-model="loginForm.code" auto-complete="off" placeholder="请输入验证码"
               style="width: 62%;margin-top:20px" @keyup.enter.native="handleLogin" class="custom-input-style">
@@ -228,14 +228,23 @@
               })
             }
 
-            this.$router.push({
-              //path: this.redirect || "/"
-              path: "/news/highlights"
-            }).catch(() => {});
+
+              this.$router.push({
+                //path: this.redirect || "/"
+                path: "/news/highlights"
+              }).catch(() => {});
+
+
 
           }
         });
       },
+      checkMobile() {
+        const userAgent = navigator.userAgent || navigator.vendor || window.opera;
+        const isMOBILE = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent);
+        // console.log('isMobile:',this.isMobile);
+        return isMOBILE;
+      },
       // getDefault() {
       // this.changeGray = true;
       // this.$store.dispatch('settings/changeSetting', {
@@ -341,10 +350,13 @@
             }
             this.$store.dispatch("Login", this.loginForm).then(() => {
               // this.getDefault()
+              // this.$router.push({
+              //   //path: this.redirect || "/"
+              //   path: "/news/highlights"
+              // }).catch(() => {});
               this.$router.push({
-                //path: this.redirect || "/"
-                path: "/news/highlights"
-              }).catch(() => {});
+                path: "/meeting_pad",
+              });
 
             }).catch(() => {
               this.loading = false;