From fdd38a72d0b0b87724aa94f7f9b5b0885f34cff5 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 12 十二月 2024 16:51:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 h5/pages/login/login.vue |   55 ++++++++++++++++++++++++++++++-------------------------
 1 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/h5/pages/login/login.vue b/h5/pages/login/login.vue
index 6fb7207..f4d558d 100644
--- a/h5/pages/login/login.vue
+++ b/h5/pages/login/login.vue
@@ -41,12 +41,16 @@
 	export default {
 		data() {
 			return {
-				code: ''
+				code: '111'
 			}
 		},
 		onLoad(option) {
-			if(option.type){
-				
+			if(option.ywid){
+				uni.setStorageSync('ywinfo', {
+					type: option.type,
+					yw: option.yw,
+					ywid: option.ywid
+				})
 			}
 		},
 		onShow() {
@@ -54,7 +58,10 @@
 			let url = 'https://atwl.ahzyssl.com/zhyq_h5/#/'
 			let code = ''
 			if (window.location.href.indexOf('code=') !== -1 || this.code) {
-
+				const ywinfo = uni.getStorageSync('ywinfo') || {}
+				 if(ywinfo.ywid){
+					 this.userAuth(ywinfo.type)
+				 }
 			} else {
 				// let url = window.location.href
 				const appID = 'wx173e6caf5abc718a'
@@ -119,27 +126,25 @@
 								that.$store.commit('setMember', res.data.member)
 							}
 							let flag = res.data.member && res.data.member.id
-							setTimeout(() => {
-								if (source == 0) {
-									if (res.data.token) {
-										that.$store.commit('setToken', res.data.token)
-										getUserInfo().then(ress => {
-											that.$store.commit('setDriverInfo', ress.data)
-										})
-									}
-									this.driverLogin(flag)
-								} else if (source == 2) {
-									if (res.data.token) {
-										that.$store.commit('setToken', res.data.token)
-										getUserInfo().then(ress => {
-											that.$store.commit('setUserInfo', ress.data)
-										})
-									}
-									this.staffLogin(flag)
-								} else {
-									this.jump('/pages/index/index')
-								}
-							}, 300)
+							if (source == 0) {
+								if (res.data.token) {
+									that.$store.commit('setToken', res.data.token)
+									getUserInfo().then(ress => {
+										that.$store.commit('setDriverInfo', ress.data)
+									})
+								}
+								this.driverLogin(flag)
+							} else if (source == 2) {
+								if (res.data.token) {
+									that.$store.commit('setToken', res.data.token)
+									getUserInfo().then(ress => {
+										that.$store.commit('setUserInfo', ress.data)
+									})
+								}
+								this.staffLogin(flag)
+							} else {
+								this.jump('/pages/index/index')
+							}
 						}
 					})
 				}

--
Gitblit v1.9.3