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

opt:部分接口新增appId字段

Shu преди 3 седмици
родител
ревизия
87af5ee28e
променени са 2 файла, в които са добавени 9 реда и са изтрити 5 реда
  1. 6 2
      pages/home/home.vue
  2. 3 3
      pages/login/login.vue

+ 6 - 2
pages/home/home.vue

@@ -142,7 +142,8 @@
 						"showMessage": "点击进入酒店小超市, 挑选心仪商品",
 						"type": "top"
 					}
-				]
+				],
+				appId: ''
 			};
 		},
 		computed: {
@@ -228,6 +229,8 @@
 			}
 		},
 		async onLoad() {
+			const {miniProgram: {appId}} = uni.getAccountInfoSync();
+			this.appId = appId
 			// console.log(__wxConfig)
 			//获取openid
 			if (!this.userInfo.openid) {
@@ -237,7 +240,8 @@
 						if (res.code) {
 							//发起网络请求
 							uni.$http.post('/user/weChatOpenid', {
-								code: res.code
+								code: res.code,
+								appId: this.appId
 							}).then((res) => {
 								this.userInfo.openid = res.data.data
 								this.updateUserInfo(this.userInfo)

+ 3 - 3
pages/login/login.vue

@@ -65,9 +65,7 @@
 
 <script>
 	import {
-		numberNotZero,
 		stringHasText,
-		jsonParamIsTrue,
 	} from '../../utils/commonUtils.js'
 	import {
 		IMG_BASE_URL
@@ -87,6 +85,7 @@
 				hotelId: null,
 				version: '',
 				isQuickLogin: true,
+				appId: ''
 			}
 		},
 		computed: {
@@ -137,7 +136,8 @@
 
 					let res = await uni.$http.post('/user/quickLogin', {
 						code: e.detail.code,
-						platform: "WECHAT"
+						platform: "WECHAT",
+						appId: this.appId
 					})
 					if (res.data.code === 200 && res.data.success === true) {
 						await this.afterLoginSuccess(res)