Browse Source

fix: 增加第三方登录-无token显示错误问题

xieyonghong 3 năm trước cách đây
mục cha
commit
fe58aad14d
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      src/pages/account/Center/bind/index.tsx

+ 2 - 1
src/pages/account/Center/bind/index.tsx

@@ -47,6 +47,7 @@ const Bind = () => {
   };
 
   const getDetail = () => {
+    if (!localStorage.getItem('X-Access-Token')) return;
     service.getUserDetail().subscribe((res) => {
       setUser(res?.result);
     });
@@ -178,7 +179,7 @@ const Bind = () => {
   }, [window.location.href]);
 
   useEffect(() => {
-    if (isLogin === 'yes' && localStorage.getItem('X-Access-Token')) {
+    if (isLogin === 'yes') {
       getDetail();
     }
   }, [isLogin]);