Kaynağa Gözat

登录用户拒绝授权清楚token

DELL 3 yıl önce
ebeveyn
işleme
909e9ada2d
2 değiştirilmiş dosya ile 13 ekleme ve 3 silme
  1. 7 1
      src/components/auth/auth.vue
  2. 6 2
      src/pages/login/index.vue

+ 7 - 1
src/components/auth/auth.vue

@@ -95,7 +95,13 @@
             }).catch(() => {
               _this.authIng = false
             })
-          }
+          },
+		  fail: (res)=>{
+				uni.$u.toast('授权失败');
+				uni.removeStorageSync('token')
+				_this.authIng = false
+				_this.$emit('fail')
+		  }
         })
       }
     }

+ 6 - 2
src/pages/login/index.vue

@@ -41,7 +41,7 @@
       </view>
     </view>
 
-    <auth :auth-show="authShow" :auth-token="token" @close="authClose" />
+    <auth :auth-show="authShow" :auth-token="token" @close="authClose" @fail="fail" />
   </view>
 </template>
 
@@ -137,7 +137,10 @@
           }
         }
       },
-
+		//拒绝授权
+		fail(){
+			this.authShow = false
+		},
       // 关闭授权
       authClose() {
         this.authShow = false
@@ -223,6 +226,7 @@
                 _this.getBaseInfoAli()
               }else{
                 uni.hideLoading();
+				
               }
             })
             },