|
@@ -7,13 +7,15 @@
|
7
|
7
|
<i class="iconfont iconjiantouright"></i>
|
8
|
8
|
</li>
|
9
|
9
|
</ul>
|
10
|
|
- <a>退出登录</a>
|
|
10
|
+ <a @click="SignOut">退出登录</a>
|
11
|
11
|
</MainPageContainer>
|
12
|
12
|
</div>
|
13
|
13
|
</template>
|
14
|
14
|
|
15
|
15
|
<script>
|
16
|
16
|
import MainPageContainer from '../../../components/common/MainPageContainer'
|
|
17
|
+import { createNamespacedHelpers } from 'vuex'
|
|
18
|
+const { mapMutations: mapUserMutations } = createNamespacedHelpers('user')
|
17
|
19
|
export default {
|
18
|
20
|
name: 'index',
|
19
|
21
|
data () {
|
|
@@ -32,10 +34,19 @@ export default {
|
32
|
34
|
})
|
33
|
35
|
},
|
34
|
36
|
methods: {
|
|
37
|
+ ...mapUserMutations([
|
|
38
|
+ 'EmptyUserInfo'
|
|
39
|
+ ]),
|
35
|
40
|
Refresh (done) { // 页面下拉刷新
|
36
|
41
|
window.setTimeout(() => {
|
37
|
42
|
done()
|
38
|
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
|
}
|