MrShi
12 小时以前 ac33a3140ef8ef20dfd2537fce2dfdd0f374f30e
mini-program/pages/login/login.vue
@@ -66,13 +66,18 @@
          async checkShopLogin(){
            uni.showLoading( )
            var that =this
            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()
               }else if( this.openid !=null && this.openid !=''){
                        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)
@@ -80,6 +85,8 @@
                     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) {
@@ -91,6 +98,12 @@
            setTimeout(function () {
               uni.hideLoading();
            }, 1000);
            }catch(e){
               setTimeout(function () {
                  uni.hideLoading();
               }, 1000);
            }
         },  
         changeRadio(){
            this.radio = !this.radio