فهرست منبع

如果是短信登录,则用户为求职者,调用退出登录接口会报错

lifanagju_citu 1 ماه پیش
والد
کامیت
a217b727a4
1فایلهای تغییر یافته به همراه8 افزوده شده و 3 حذف شده
  1. 8 3
      store/user.js

+ 8 - 3
store/user.js

@@ -146,9 +146,14 @@ export const userStore = defineStore('user', {
 
     // 登出系统
     async handleLogout() {
-      await logout(uni.getStorageSync('token'))
-      this.resetUserData();
-      return !this.isLogin;
+      try {
+        await logout(uni.getStorageSync('token'))
+        this.resetUserData()
+      } catch (error) {
+        console.log('handleLogout:error', error)
+        this.resetUserData()
+      }
+      // return !this.isLogin;
     },
     // 账号注册-回到首页
     async handleUserLogout () {