Browse Source

修复 退出登录失效问题

魏熙美 6 years ago
parent
commit
3e37c34a64
3 changed files with 7 additions and 6 deletions
  1. 0
    2
      src/layout/default/index.vue
  2. 5
    4
      src/store/system.js
  3. 2
    0
      src/views/Login.vue

+ 0
- 2
src/layout/default/index.vue View File

@@ -95,8 +95,6 @@ export default {
95 95
     }
96 96
   },
97 97
   created () {
98
-    // 默认进入欢迎语页面
99
-    this.$router.push({ name: 'indexWelcome' })
100 98
     // if (this.$route.path.indexOf('exception') === -1) {
101 99
     //   this.$store.dispatch('getUser').then(() => {
102 100
     //     this.menuArray = pageArray

+ 5
- 4
src/store/system.js View File

@@ -15,10 +15,11 @@ export default {
15 15
   },
16 16
   mutations: {
17 17
     updateUser(state, user) {
18
-      state.user = {
19
-        ...state.user,
20
-        ...user,
21
-      }
18
+      // state.user = {
19
+      //   ...state.user,
20
+      //   ...user,
21
+      // }
22
+      state.user = user
22 23
     },
23 24
     syncState(state, payload = {}) {
24 25
       Object.keys(payload).forEach(k => state[k] = payload[k])

+ 2
- 0
src/views/Login.vue View File

@@ -66,6 +66,8 @@ export default {
66 66
     submit() {
67 67
       this.login({ username: this.formdata.username, password: md5(this.formdata.password) }).then(() => {
68 68
         this.$router.push({ name: this.fromRoute })
69
+        // 默认进入欢迎语页面
70
+        this.$router.push({ name: 'indexWelcome' })
69 71
       }).catch((err) => {
70 72
         this.$message({
71 73
           showClose: true,