Parcourir la source

首页跳转,缓存名称

zwq il y a 6 ans
Parent
commit
13c474cea2
2 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 2 2
      src/router.js
  2. 2 2
      src/view/login/index.vue

+ 2 - 2
src/router.js

@@ -1,6 +1,6 @@
 import Vue from 'vue';
 import Router from 'vue-router';
-import {getStore} from "@/utils/storage";
+// import {getStore} from "@/utils/storage";
 
 Vue.use(Router);
 
@@ -130,7 +130,7 @@ router.beforeEach((to, from, next) => {
     // if (to.name === 'login' || to.name === 'stafflogin' || to.name === 'invitation' || to.name === 'next') {
     //     next()
     // } else {
-    //     if (getStore('token')) {
+    //     if (getStore('login')) {
     //         next()
     //     } else {
     //         next({name: '/login'})

+ 2 - 2
src/view/login/index.vue

@@ -109,7 +109,7 @@
         created() {
             //企业已登录,跳转企业首页
             if (getStore('login')) {
-                this.$router.replace({path: '/business', query: {enterprise_id: 123}});
+                this.$router.replace({path: '/index', query: {enterprise_id: 123}});
             }
         },
         methods: {
@@ -117,7 +117,7 @@
                 this.loading = true;
                 //登录成功,缓存用户信息,跳转相应页面
                 setStore('login', "123");
-                this.$router.replace({path: '/business', query: {enterprise_id: 123}});
+                this.$router.replace({path: '/index', query: {enterprise_id: 123}});
             },
             //获取验证码
             sendCode() {