整合通讯录组件渲染

This commit is contained in:
aixianling
2022-07-19 15:20:10 +08:00
parent d58b590200
commit d1c92c569f
3 changed files with 17 additions and 50 deletions

View File

@@ -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>