整合通讯录组件渲染
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
import SliderNav from "./components/sliderNav";
|
||||
import MainContent from "./components/mainContent";
|
||||
import HeaderNav from "./components/headerNav";
|
||||
import {mapMutations, mapState} from "vuex";
|
||||
import {mapActions, mapMutations, mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: 'app',
|
||||
@@ -42,7 +42,8 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['setToken']),
|
||||
...mapMutations(['setToken', 'setFinanceUser']),
|
||||
...mapActions(['getUserInfo']),
|
||||
getToken(params) {
|
||||
if (params.access_token) {
|
||||
this.setToken([params.token_type, params.access_token].join(' '))
|
||||
@@ -52,16 +53,6 @@ export default {
|
||||
} else this.$message.error(params.msg || "登录失败!")
|
||||
|
||||
},
|
||||
getUserInfo() {
|
||||
this.$axios.post("/admin/user/detail-phone").then(res => {
|
||||
if (res?.data) {
|
||||
this.$store.commit("setUserInfo", res.data)
|
||||
if (/^\/project\/xiushan/.test(location.pathname)) {
|
||||
this.$store.commit("setFinanceUser")
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleLogin() {
|
||||
this.$axios.delete("/auth/token/logout").finally(() => {
|
||||
this.dialog = true
|
||||
@@ -69,8 +60,12 @@ export default {
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if (this.user.token) this.getUserInfo()
|
||||
wx = jWeixin
|
||||
if (this.user.token) this.getUserInfo().then(() => {
|
||||
if (/^\/project\/xiushan/.test(location.pathname)) {
|
||||
this.setFinanceUser()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user