lmc před 1 rokem
rodič
revize
75dc563227

+ 4 - 4
src/App.vue

@@ -18,7 +18,7 @@ export default {
   },
 
   created() {
-    console.log('app')
+    console.log("app");
     const username = getUrlKey("username");
     const password = getUrlKey("password");
     this.getDictAll();
@@ -29,7 +29,7 @@ export default {
         this.login(username, password);
       } else {
         this.loading = true;
-        window.location.href = "/#/login";
+        this.$router.push({ path: "/login" });
       }
     }
   },
@@ -83,7 +83,7 @@ export default {
             tenantName:
               res.data.roleCodes[0] == "Tenant" ? res.data.tenantName : "",
           });
-          this.$router.push({path:'/home'})
+          this.$router.push({ path: "/home" });
         }
       });
     },
@@ -147,7 +147,7 @@ body {
 .van-dropdown-menu__bar {
   --van-dropdown-menu-box-shadow: 0;
 }
-.van-divider{
+.van-divider {
   border-color: #d8d8d8;
 }
 :root {

+ 1 - 1
src/utils/request.js

@@ -61,7 +61,7 @@ service.interceptors.response.use((response) => {
   // 判断token 失效
   if (res.code == 10021 || res.code == 10004) {
     localStorage.clear()
-    window.location.href = "/#/login"
+    this.$router.push({ path: "/login" });
     Notify({ type: "danger", message: res.msg });
   }
   if (res.code == 500) {

+ 8 - 2
src/views/login.vue

@@ -89,8 +89,14 @@ export default {
   },
   methods: {
     onSubmit() {
-      window.location.href =
-        "/?username=" + this.tel + "&&password=" + this.password;
+      let development = process.env.NODE_ENV == "development" ? true : false;
+      if (development) {
+        window.location.href =
+          "/?username=" + this.tel + "&&password=" + this.password;
+      } else {
+        window.location.href =
+          "/app/?username=" + this.tel + "&&password=" + this.password;
+      }
     },
   },
 };

+ 1 - 1
src/views/user/account.vue

@@ -92,7 +92,7 @@ export default {
 
     loginOut() {
       localStorage.clear();
-      window.location.href = "/#/login";
+     this.$router.push({ path: "/login" });
     },
 
     backPath() {

+ 1 - 1
src/views/user/password.vue

@@ -241,7 +241,7 @@ export default {
           Cookies.remove("userName");
           Cookies.remove("passWord");
           localStorage.clear();
-          window.location.href = "/#/login";
+          this.$router.push({ path: "/login" });
         } else {
           this.$toast.fail("修改失败");
         }