cmy 5 лет назад
Родитель
Сommit
a023147eb6
1 измененных файлов с 23 добавлено и 20 удалено
  1. 23 20
      pages/public/wxLogin.vue

+ 23 - 20
pages/public/wxLogin.vue

@@ -70,29 +70,32 @@ export default {
 			let user = obj.userInfo;
 			let user = obj.userInfo;
 			// 获取推广人id
 			// 获取推广人id
 			let spread_spid = uni.getStorageSync('spread') || '';
 			let spread_spid = uni.getStorageSync('spread') || '';
+			// let spread_code = uni.getStorageSync('spread_code') || '';
 			uni.showLoading({
 			uni.showLoading({
 				title: '授权中',
 				title: '授权中',
-				mask:true
+				mask: true
 			});
 			});
-			loginWinxinMp().then(e => {
-				this.code = e.code;
-				wechatMpAuth({
-					code: this.code,
-					iv: user.target.iv,
-					encryptedData: user.target.encryptedData,
-					spread_spid: spread_spid
-				})
-					.then(({ data }) => {
-						obj.loding = false;
-						obj.wchatAuth(data);
+			loginWinxinMp()
+				.then(e => {
+					this.code = e.code;
+					wechatMpAuth({
+						code: this.code,
+						iv: user.target.iv,
+						encryptedData: user.target.encryptedData,
+						spread_spid: spread_spid
 					})
 					})
-					.catch(e => {
-						obj.loding = false;
-						uni.hideLoading();
-					});
-			}).catch((e) => {
-				uni.hideLoading();
-			});
+						.then(({ data }) => {
+							obj.loding = false;
+							obj.wchatAuth(data);
+						})
+						.catch(e => {
+							obj.loding = false;
+							uni.hideLoading();
+						});
+				})
+				.catch(e => {
+					uni.hideLoading();
+				});
 		},
 		},
 		wchatAuth(data) {
 		wchatAuth(data) {
 			let obj = this;
 			let obj = this;
@@ -143,7 +146,7 @@ export default {
 			let obj = this;
 			let obj = this;
 			obj.MaskShow = false;
 			obj.MaskShow = false;
 			(obj.iv = e.detail.iv), (obj.encryptedData = e.detail.encryptedData);
 			(obj.iv = e.detail.iv), (obj.encryptedData = e.detail.encryptedData);
-		
+
 			uni.setStorageSync('code', obj.code);
 			uni.setStorageSync('code', obj.code);
 			bangding({
 			bangding({
 				flag: 1,
 				flag: 1,