From b7f74340de27a3427d8afb8750724b788c8a780c Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期四, 06 二月 2025 18:17:19 +0800
Subject: [PATCH] 改bug

---
 h5/pages/login.vue |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/h5/pages/login.vue b/h5/pages/login.vue
index 840eba8..dc65036 100644
--- a/h5/pages/login.vue
+++ b/h5/pages/login.vue
@@ -45,14 +45,20 @@
 				form: {
 					phone: '',
 					code: ''
-				},
+				},
+				ywinfo: {},
 				downTime: 0,
 				code: ''
 			}
 		},
 		onLoad(option) {
 			console.log('onLoad');
-			// https://zhcg.fnwtzx.com/#/pages/login?type=0&ywid=ywid
+			// https://zhcg.fnwtzx.com/#/pages/login?type=0&ywid=ywid
+			const ywinfo = uni.getStorageSync('ywinfo') || {}
+			if (ywinfo.ywid && (ywinfo.type || ywinfo.type == 0)) {
+				this.ywinfo = ywinfo
+				uni.setStorageSync('ywinfo', {})
+			}
 			if (option.ywid || option.ywid == 0) {
 				uni.setStorageSync('ywinfo', {
 					type: option.type,
@@ -84,11 +90,10 @@
 							getUserInfo().then(ress => {
 								that.$store.commit('setUserInfo', ress.data)
 							})
-							const ywinfo = uni.getStorageSync('ywinfo') || {}
+							const ywinfo = this.ywinfo
 							if (ywinfo.ywid && (ywinfo.type || ywinfo.type == 0)) {
 								getRecordByUserPoint({pointCode: ywinfo.ywid}).then(res => {
 									if(res.data && res.data.id){
-										uni.setStorageSync('ywinfo', {})
 										uni.redirectTo({
 											url: "/pages/polling/point?id=" + res.data.id
 										})
@@ -105,8 +110,10 @@
 					}
 				})
 			} else {
-				let url = 'https://zhcg.fnwtzx.com/yunwei_h5'
-				const appID = 'wx95ac1efb67f0330d'
+				// let url = 'https://zhcg.fnwtzx.com/yunwei_h5'
+				// const appID = 'wx95ac1efb67f0330d'
+				let url = 'https://dmtest.ahapp.net/yunwei_h5'
+				const appID = 'wx4d7c10bdec51942b'
 				let uri = encodeURIComponent(url)
 				let authURL =
 					`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appID}&redirect_uri=${uri}&response_type=code&scope=snsapi_base#wechat_redirect`
@@ -139,12 +146,11 @@
 						this.showToast('鐧诲綍鎴愬姛')
 						getUserInfo().then(ress => {
 							this.setUserInfo(ress.data)
-							const ywinfo = uni.getStorageSync('ywinfo') || {}
+							const ywinfo = this.ywinfo
 							if (ywinfo.ywid && (ywinfo.type || ywinfo.type == 0)) {
 							getRecordByUserPoint({pointCode: ywinfo.ywid}).then(res => {
 								getRecordByUserPoint({pointCode: ywinfo.ywid}).then(res => {
 									if(res.data && res.data.id){
-										uni.setStorageSync('ywinfo', {})
 										uni.redirectTo({
 											url: "/pages/polling/point?id=" + res.data.id
 										})

--
Gitblit v1.9.3