全局增加关于登录信息的扩展埋点
This commit is contained in:
		| @@ -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() | ||||
|       } | ||||
|     }) | ||||
|   } | ||||
|   | ||||
| @@ -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()] | ||||
|   | ||||
							
								
								
									
										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