优化设置
This commit is contained in:
@@ -44,14 +44,17 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['setToken']),
|
...mapMutations(['setToken']),
|
||||||
getToken(params) {
|
getToken(params) {
|
||||||
this.setToken([params.token_type, params.access_token].join(' '))
|
if (params.access_token) {
|
||||||
this.dialog = false
|
this.setToken([params.token_type, params.access_token].join(' '))
|
||||||
this.$message.success("登录成功,正在刷新页面...")
|
this.dialog = false
|
||||||
location.reload()
|
this.$message.success("登录成功,正在刷新页面...")
|
||||||
|
location.reload()
|
||||||
|
} else this.$message.error(params.msg || "登录失败!")
|
||||||
|
|
||||||
},
|
},
|
||||||
getUserInfo() {
|
getUserInfo() {
|
||||||
this.$axios.post("/admin/user/detail-phone").then(res => {
|
this.$axios.post("/admin/user/detail-phone").then(res => {
|
||||||
if (res && res.data) {
|
if (res?.data) {
|
||||||
this.$store.commit("setUserInfo", res.data)
|
this.$store.commit("setUserInfo", res.data)
|
||||||
if (/^\/project\/xiushan/.test(location.pathname)) {
|
if (/^\/project\/xiushan/.test(location.pathname)) {
|
||||||
this.$store.commit("setFinanceUser")
|
this.$store.commit("setFinanceUser")
|
||||||
@@ -60,7 +63,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleLogin() {
|
handleLogin() {
|
||||||
this.$axios.delete("/auth/token/logout").then(() => {
|
this.$axios.delete("/auth/token/logout").finally(() => {
|
||||||
this.dialog = true
|
this.dialog = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user