Преглед на файлове

查验那边跳转过来在header增加参数

jwyu преди 7 месеца
родител
ревизия
b1d701cb8e
променени са 3 файла, в които са добавени 13 реда и са изтрити 1 реда
  1. 3 0
      App.vue
  2. 8 0
      store/modules/user.js
  3. 2 1
      utils/request.js

+ 3 - 0
App.vue

@@ -2,6 +2,9 @@
 	import {hasUpdate} from '@/utils/common.js'
 	export default {
 		onLaunch: function(options) {
+			if(options.query.thirdCode){
+				this.$store.commit('setThirdCode',options.query.thirdCode)
+			}
 			this.$store.dispatch('getUserInfo')
 			this.$store.dispatch('getTabBar')
 			const ENV=uni.getAccountInfoSync().miniProgram

+ 8 - 0
store/modules/user.js

@@ -8,6 +8,8 @@ const userModules = {
 		userInfo: {},
 
 		tabbarList: [], //用户的tabbar
+
+		thirdCode:'',//第三方跳转来带的code
 	},
 	mutations: {
 		// 设置token
@@ -34,6 +36,12 @@ const userModules = {
 			})
 			state.tabbarList=arr
 		},
+
+		// 第三方跳转来带的参数
+		setThirdCode(state,data){
+			console.log('data',data);
+			state.thirdCode=data
+		}
 	},
 	actions: {
 		// 获取个人信息

+ 2 - 1
utils/request.js

@@ -97,7 +97,8 @@ const http=(url,params,method)=>{
 			method:method,
 			header:{
 				Authorization:store.state.user.token,
-				version:'yb11.9'
+				version:'yb11.9',
+				thirdCode:store.state.user.thirdCode
 			},
 			success(e) {
 				// 接口404