From 5c3c04b9705db216d199053afc278324ed766f14 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期二, 10 二月 2026 16:07:34 +0800
Subject: [PATCH] 经销商管理

---
 mini-program/pages/login/login.vue |   36 +++++++++++++++++++++++++-----------
 1 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/mini-program/pages/login/login.vue b/mini-program/pages/login/login.vue
index 391c0ef..8c69f69 100644
--- a/mini-program/pages/login/login.vue
+++ b/mini-program/pages/login/login.vue
@@ -52,19 +52,32 @@
 			this.focus=false
 			this.focus1=false
 			this.form.openid=this.openid
-			this.checkLogin()
+			 this.checkShopLogin()
 		},
 		methods:{
-			checkLogin(){
-				if( !this.shopInfo && !this.shopToken){
-					let res = await that.$u.api.getUserInfo()
+		    async checkShopLogin(){
+				var that =this
+				console.log("shopInfo",this.shopInfo)
+				console.log("shopToken",this.shopToken)
+				
+				console.log("openid",this.openid)
+				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('setUserInfo', res.data)
-						await that.$store.commit('setOpenId', res.data.openId)
-						this.jumpShopIndex()
+						await that.$store.commit('setShopInfo', res.data) 
+						that.jumpShopIndex()
+					}
+				}else if( this.openid !=null && this.openid !=''){
+					//浼樺厛闈欓粯鐧婚檰
+					let res = await that.$u.api.shopOpenidLogin(this.form)
+					if (res.code === 200 && res.shop!=null && res.token!=null) {
+						await that.$store.commit('setShopInfo', res.data.shop)
+						await that.$store.commit('setShopToken', res.data.token)
+						that.jumpShopIndex()
 					}
 				}
-			},
+			},  
 			changeRadio(){
 				this.radio = !this.radio
 			},
@@ -92,12 +105,13 @@
 					this.loading=false
 					return
 				}
+				var that =this
 				this.$u.api.shopPasswordLogin(this.form)
 					.then(res => {
 						if (res.code === 200) { 
-							await that.$store.commit('setShopInfo', res.data.member)
-							await that.$store.commit('setShopToken', res.data.token)
-							this.jumpShopIndex()
+							that.$store.commit('setShopInfo', res.data.shop)
+							that.$store.commit('setShopToken', res.data.token)
+							that.jumpShopIndex()
 						}
 					})
 			},

--
Gitblit v1.9.3