提交 d09e8793 authored 作者: 王鹏飞's avatar 王鹏飞

fix: 修复退出登录的问题

上级 c521506e
...@@ -22,5 +22,14 @@ ...@@ -22,5 +22,14 @@
</head> </head>
<body {{ BODY_ATTRS }}> <body {{ BODY_ATTRS }}>
{{ APP }} {{ APP }}
<script>
var _hmt = _hmt || []
;(function() {
var hm = document.createElement('script')
hm.src = 'https://hm.baidu.com/hm.js?c29be2e1d21ce64d1534ece3acbf4ab5'
var s = document.getElementsByTagName('script')[0]
s.parentNode.insertBefore(hm, s)
})()
</script>
</body> </body>
</html> </html>
...@@ -41,9 +41,7 @@ export default { ...@@ -41,9 +41,7 @@ export default {
}, },
methods: { methods: {
logout() { logout() {
this.$store.dispatch('logout').then(() => { this.$store.dispatch('logout')
this.$router.replace('/')
})
}, },
switchLocale(locale) { switchLocale(locale) {
this.$i18n.locale = locale this.$i18n.locale = locale
......
...@@ -32,9 +32,9 @@ export const actions = { ...@@ -32,9 +32,9 @@ export const actions = {
}, },
// 退出登录 // 退出登录
logout({ commit }) { logout({ commit }) {
return logout().then(response => { logout().then(response => {
commit('setUser', {}) commit('setUser', {})
return response this.$router.replace('/')
}) })
}, },
// 检测登录状态 // 检测登录状态
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论