全局增加关于登录信息的扩展埋点
This commit is contained in:
@@ -43,7 +43,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['setToken', 'setFinanceUser']),
|
...mapMutations(['setToken', 'getFinanceUser']),
|
||||||
...mapActions(['getUserInfo']),
|
...mapActions(['getUserInfo']),
|
||||||
getToken(params) {
|
getToken(params) {
|
||||||
if (params.access_token) {
|
if (params.access_token) {
|
||||||
@@ -62,9 +62,9 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
wx = jWeixin
|
wx = jWeixin
|
||||||
if (this.user.token) this.getUserInfo().then(() => {
|
if (this.user.token) this.getUserInfo().finally(() => {
|
||||||
if (/^\/project\/xiushan/.test(location.pathname)) {
|
if (/^\/project\/xiushan/.test(location.pathname)) {
|
||||||
this.setFinanceUser()
|
this.getFinanceUser()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import Vue from 'vue'
|
|||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
import preState from 'vuex-persistedstate'
|
import preState from 'vuex-persistedstate'
|
||||||
import * as modules from "dvcp-ui/lib/js/modules"
|
import * as modules from "dvcp-ui/lib/js/modules"
|
||||||
import axios from "../router/axios";
|
import xsMutations from "../../project/xiushan/mutations"
|
||||||
|
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
|
|
||||||
@@ -17,11 +17,7 @@ export default new Vuex.Store({
|
|||||||
cleanApps(state) {
|
cleanApps(state) {
|
||||||
state.apps = []
|
state.apps = []
|
||||||
},
|
},
|
||||||
setFinanceUser(state) {
|
...xsMutations
|
||||||
axios.post("appfinancialorganizationuser/checkUser").then(res => {
|
|
||||||
state.user.financeUser = res.data
|
|
||||||
}).catch(() => 0)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
modules,
|
modules,
|
||||||
plugins: [preState()]
|
plugins: [preState()]
|
||||||
|
|||||||
9
project/xiushan/mutations.js
Normal file
9
project/xiushan/mutations.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user