From c26a61d57123adf4b7f097661bb032b762ec3d84 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 26 二月 2026 17:05:26 +0800
Subject: [PATCH] 经销商管理

---
 mini-program/pages/login/login.vue |   49 +++++++++++++++++++++++++++++++------------------
 1 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/mini-program/pages/login/login.vue b/mini-program/pages/login/login.vue
index 2aa3441..9c12544 100644
--- a/mini-program/pages/login/login.vue
+++ b/mini-program/pages/login/login.vue
@@ -66,12 +66,27 @@
 		    async checkShopLogin(){
 				uni.showLoading( )
 				var that =this
-				if( this.shopInfo !=null && this.shopInfo.id!=null && (this.shopToken!=null &&this.shopToken!='')){
-					//楠岃瘉token鏄惁鏈夋晥
-					let res = await that.$u.api.getShopInfo({tokenType:1  })
-					if (res.code === 200) {
-						await that.$store.commit('setShopInfo', res.data) 
-						that.jumpShopIndex()
+				try{
+					if( this.shopInfo !=null && this.shopInfo.id!=null && (this.shopToken!=null &&this.shopToken!='')){
+						//楠岃瘉token鏄惁鏈夋晥
+						try{
+							let res = await that.$u.api.getShopInfo({tokenType:1  })
+							if (res.code === 200) {
+								await that.$store.commit('setShopInfo', res.data) 
+								that.jumpShopIndex()
+								return
+							} 
+						}catch(e){
+							if( this.openid !=null && this.openid !=''){
+								let res = await that.$u.api.shopOpenidLogin(this.form)
+									if (res.code === 200 && res.data.shop!=null && res.data.token!=null) {
+									await that.$store.commit('setShopInfo', res.data.shop)
+									await that.$store.commit('setShopToken', res.data.token)
+									that.jumpShopIndex()
+								}
+							}
+						}
+						
 					}else if( this.openid !=null && this.openid !=''){
 						let res = await that.$u.api.shopOpenidLogin(this.form)
 							if (res.code === 200 && res.data.shop!=null && res.data.token!=null) {
@@ -79,18 +94,16 @@
 							await that.$store.commit('setShopToken', res.data.token)
 							that.jumpShopIndex()
 						}
-					}
-				}else if( this.openid !=null && this.openid !=''){
-					let res = await that.$u.api.shopOpenidLogin(this.form)
-						if (res.code === 200 && res.data.shop!=null && res.data.token!=null) {
-						await that.$store.commit('setShopInfo', res.data.shop)
-						await that.$store.commit('setShopToken', res.data.token)
-						that.jumpShopIndex()
-					}
-				} 
-				setTimeout(function () {
-					uni.hideLoading();
-				}, 1000);
+					} 
+					setTimeout(function () {
+						uni.hideLoading();
+					}, 1000);
+				}catch(e){
+					setTimeout(function () {
+						uni.hideLoading();
+					}, 1000);
+				}
+				
 			},  
 			changeRadio(){
 				this.radio = !this.radio

--
Gitblit v1.9.3