Browse Source

静态页面

1002884655 4 years ago
parent
commit
c29f3344c0
1 changed files with 12 additions and 1 deletions
  1. 12
    1
      src/pages/WoDe/GeRenSheZhi/index.vue

+ 12
- 1
src/pages/WoDe/GeRenSheZhi/index.vue View File

7
           <i class="iconfont iconjiantouright"></i>
7
           <i class="iconfont iconjiantouright"></i>
8
         </li>
8
         </li>
9
       </ul>
9
       </ul>
10
-      <a>退出登录</a>
10
+      <a @click="SignOut">退出登录</a>
11
     </MainPageContainer>
11
     </MainPageContainer>
12
   </div>
12
   </div>
13
 </template>
13
 </template>
14
 
14
 
15
 <script>
15
 <script>
16
 import MainPageContainer from '../../../components/common/MainPageContainer'
16
 import MainPageContainer from '../../../components/common/MainPageContainer'
17
+import { createNamespacedHelpers } from 'vuex'
18
+const { mapMutations: mapUserMutations } = createNamespacedHelpers('user')
17
 export default {
19
 export default {
18
   name: 'index',
20
   name: 'index',
19
   data () {
21
   data () {
32
     })
34
     })
33
   },
35
   },
34
   methods: {
36
   methods: {
37
+    ...mapUserMutations([
38
+      'EmptyUserInfo'
39
+    ]),
35
     Refresh (done) { // 页面下拉刷新
40
     Refresh (done) { // 页面下拉刷新
36
       window.setTimeout(() => {
41
       window.setTimeout(() => {
37
         done()
42
         done()
38
       }, 1000)
43
       }, 1000)
44
+    },
45
+    SignOut () { // 登出
46
+      this.EmptyUserInfo()
47
+      window.localStorage.removeItem('niucaiadminname')
48
+      window.localStorage.removeItem('niucaiadminpassword')
49
+      this.$router.push({ name: 'SignIn' })
39
     }
50
     }
40
   }
51
   }
41
 }
52
 }