feat: add login blocking; 🌟

新增:登录拦截功能;
This commit is contained in:
chenghongxing
2020-07-20 22:39:46 +08:00
parent d21a2ab062
commit 4e6a060dfe
7 changed files with 79 additions and 12 deletions

View File

@@ -110,9 +110,9 @@ export default {
const result = res.data
if (result.code >= 0) {
const user = result.data.user
setAuthorization({token: result.data.token, expireAt: new Date(result.data.expireAt)})
this.$router.push('/dashboard/workplace')
this.$store.commit('account/setUser', user)
setAuthorization({token: result.data.token})
this.$message.success(result.message, 3)
} else {
this.error = result.message