doum
2026-04-22 4f604171623fb28f81bfcec07bd25737d7284649
small-program/shop/pages/login/login.vue
@@ -39,7 +39,7 @@
   export default {
      computed: {
         ...mapState(['openid'])
         ...mapState(['openid', 'userInfo'])
      },
      data() {
         return {
@@ -48,6 +48,23 @@
               telephone: '',
               password: ''
            }
         }
      },
      onLoad() {
         // 静默登录
         if (this.userInfo.bindShopId) {
            this.$u.api.shopSilentLogin({})
               .then(res => {
                  if (res.code === 200) {
                     this.$store.commit('setUserType', 1)
                     this.$store.commit('setShopToken', res.data.token)
                     setTimeout(() => {
                        uni.reLaunch({
                           url: '/shop/pages/store-home/store-home'
                        });
                     }, 500)
                  }
               })
         }
      },
      methods: {
@@ -86,9 +103,9 @@
                  this.$store.commit('setShopToken', res.data.token)
                  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({