From a2299a6d4a6f99e9c11132138f5d3e9ec68f03ea Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 06 六月 2025 19:19:34 +0800
Subject: [PATCH] 开发更新

---
 h5/pages/login.vue |   80 ++++++++++++++++++++++++---------------
 1 files changed, 49 insertions(+), 31 deletions(-)

diff --git a/h5/pages/login.vue b/h5/pages/login.vue
index 840eba8..134d69c 100644
--- a/h5/pages/login.vue
+++ b/h5/pages/login.vue
@@ -29,8 +29,8 @@
 		loginPost,
 		getUserInfo,
 		sendSMsPost,
-		ywWxAuthorize,
-		
+		ywWxAuthorize,
+
 		getRecordByUserPoint
 	} from '@/api'
 	import {
@@ -46,6 +46,7 @@
 					phone: '',
 					code: ''
 				},
+				ywinfo: {},
 				downTime: 0,
 				code: ''
 			}
@@ -53,6 +54,11 @@
 		onLoad(option) {
 			console.log('onLoad');
 			// 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,
@@ -77,22 +83,27 @@
 					code: code || this.code
 				}).then(res => {
 					if (res.code === 200) {
-						console.log('res', res);
+						// console.log('res', res);
 						that.$store.commit('setOpenId', res.data.openid)
 						if (res.data.token && res.data.token != '') {
 							that.$store.commit('setToken', res.data.token)
 							getUserInfo().then(ress => {
 								that.$store.commit('setUserInfo', ress.data)
 							})
-							const ywinfo = uni.getStorageSync('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
-										})
-									}
+							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.redirectTo({
+											url: "/pages/polling/point?id=" + res.data.id
+										})
+									} else {
+										uni.redirectTo({
+											url: "/pages/polling/empty?message=" + res.message
+										})
+									}
 								})
 							} else {
 								setTimeout(() => {
@@ -105,8 +116,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`
@@ -138,23 +151,28 @@
 						this.setToken(res.data)
 						this.showToast('鐧诲綍鎴愬姛')
 						getUserInfo().then(ress => {
-							this.setUserInfo(ress.data)
-							const ywinfo = uni.getStorageSync('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
-										})
-									}
-								})
-							})
-							} else {
-								uni.redirectTo({
-									url: "/pages/index"
-								})
+							this.setUserInfo(ress.data)
+							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.redirectTo({
+											url: "/pages/polling/point?id=" + res.data.id
+										})
+									} else {
+										uni.redirectTo({
+											url: "/pages/polling/empty?message=" + res.message
+										})
+									}
+								})
+								// })
+							} else {
+								uni.redirectTo({
+									url: "/pages/index"
+								})
 							}
 						})
 					}

--
Gitblit v1.9.3