全局增加关于登录信息的扩展埋点

This commit is contained in:
aixianling
2022-08-26 17:20:08 +08:00
parent b70e270475
commit 2b50fdf5a4
3 changed files with 14 additions and 9 deletions

View File

@@ -43,7 +43,7 @@ export default {
}
},
methods: {
...mapMutations(['setToken', 'setFinanceUser']),
...mapMutations(['setToken', 'getFinanceUser']),
...mapActions(['getUserInfo']),
getToken(params) {
if (params.access_token) {
@@ -62,9 +62,9 @@ export default {
},
created() {
wx = jWeixin
if (this.user.token) this.getUserInfo().then(() => {
if (this.user.token) this.getUserInfo().finally(() => {
if (/^\/project\/xiushan/.test(location.pathname)) {
this.setFinanceUser()
this.getFinanceUser()
}
})
}

View File

@@ -2,7 +2,7 @@ import Vue from 'vue'
import Vuex from 'vuex'
import preState from 'vuex-persistedstate'
import * as modules from "dvcp-ui/lib/js/modules"
import axios from "../router/axios";
import xsMutations from "../../project/xiushan/mutations"
Vue.use(Vuex)
@@ -17,11 +17,7 @@ export default new Vuex.Store({
cleanApps(state) {
state.apps = []
},
setFinanceUser(state) {
axios.post("appfinancialorganizationuser/checkUser").then(res => {
state.user.financeUser = res.data
}).catch(() => 0)
}
...xsMutations
},
modules,
plugins: [preState()]

View File

@@ -0,0 +1,9 @@
import axios from "dvcp-ui/lib/js/request";
export default {
getFinanceUser(state) {
axios.post("appfinancialorganizationuser/checkUser").then(res => {
state.user.financeUser = res.data
}).catch(() => 0)
}
}