From a80fcaaf130286f215a35aa62450421b480b4d5a Mon Sep 17 00:00:00 2001
From: renkang <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 07 二月 2025 11:41:27 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/2.0.1' into 2.0.1

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

diff --git a/h5/pages/login.vue b/h5/pages/login.vue
index dc65036..2a7e31a 100644
--- a/h5/pages/login.vue
+++ b/h5/pages/login.vue
@@ -29,8 +29,8 @@
 		loginPost,
 		getUserInfo,
 		sendSMsPost,
-		ywWxAuthorize,
-		
+		ywWxAuthorize,
+
 		getRecordByUserPoint
 	} from '@/api'
 	import {
@@ -45,7 +45,7 @@
 				form: {
 					phone: '',
 					code: ''
-				},
+				},
 				ywinfo: {},
 				downTime: 0,
 				code: ''
@@ -53,11 +53,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', {})
+			// 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', {
@@ -83,7 +83,7 @@
 					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)
@@ -91,13 +91,19 @@
 								that.$store.commit('setUserInfo', ress.data)
 							})
 							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
-										})
-									}
+							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"
+										})
+									}
 								})
 							} else {
 								setTimeout(() => {
@@ -111,8 +117,8 @@
 				})
 			} else {
 				// let url = 'https://zhcg.fnwtzx.com/yunwei_h5'
-				// const appID = 'wx95ac1efb67f0330d'
-				let url = 'https://dmtest.ahapp.net/yunwei_h5'
+				// const appID = 'wx95ac1efb67f0330d'
+				let url = 'https://dmtest.ahapp.net/yunwei_h5'
 				const appID = 'wx4d7c10bdec51942b'
 				let uri = encodeURIComponent(url)
 				let authURL =
@@ -145,22 +151,28 @@
 						this.setToken(res.data)
 						this.showToast('鐧诲綍鎴愬姛')
 						getUserInfo().then(ress => {
-							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/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"
+										})
+									}
+								})
+								// })
+							} else {
+								uni.redirectTo({
+									url: "/pages/index"
+								})
 							}
 						})
 					}

--
Gitblit v1.9.3