From 2800434db8a3117cf4f1ccb119e7ac939f0511bb Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 23 四月 2026 09:02:50 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
small-program/shop/pages/login/login.vue | 35 +++++++++++++++++++++++++++++++----
1 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/small-program/shop/pages/login/login.vue b/small-program/shop/pages/login/login.vue
index de6bb48..a139eb9 100644
--- a/small-program/shop/pages/login/login.vue
+++ b/small-program/shop/pages/login/login.vue
@@ -39,7 +39,7 @@
export default {
computed: {
- ...mapState(['openid'])
+ ...mapState(['openid', 'userInfo'])
},
data() {
return {
@@ -48,6 +48,28 @@
telephone: '',
password: ''
}
+ }
+ },
+ onLoad() {
+ // 闈欓粯鐧诲綍
+ if (this.userInfo.bindShopId) {
+ this.$u.api.shopSilentLogin({})
+ .then(async res => {
+ if (res.code === 200) {
+ this.$store.commit('setUserType', 1)
+ this.$store.commit('setShopToken', res.data.token)
+ // 鑾峰彇闂ㄥ簵淇℃伅
+ const shopInfoRes = await this.$u.api.getShopInfo({})
+ if (shopInfoRes.code === 200) {
+ this.$store.commit('setShopInfo', shopInfoRes.data)
+ }
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '/shop/pages/store-home/store-home'
+ });
+ }, 1000)
+ }
+ })
}
},
methods: {
@@ -84,11 +106,16 @@
if (res.code === 200) {
this.$store.commit('setUserType', 1)
this.$store.commit('setShopToken', res.data.token)
+ // 鑾峰彇闂ㄥ簵淇℃伅
+ const shopInfoRes = await this.$u.api.getShopInfo({})
+ if (shopInfoRes.code === 200) {
+ this.$store.commit('setShopInfo', shopInfoRes.data)
+ }
uni.showToast({ title: '鐧诲綍鎴愬姛', icon: 'success' })
setTimeout(() => {
- uni.switchTab({
- url: '/pages/shop-index/shop-index'
- })
+ uni.reLaunch({
+ url: '/shop/pages/store-home/store-home'
+ });
}, 1500)
} else {
uni.showToast({
--
Gitblit v1.9.3