Pārlūkot izejas kodu

fix: 增加第三方登录-重定向地址获取方式

xieyonghong 3 gadi atpakaļ
vecāks
revīzija
0f00126fe4
1 mainītis faili ar 6 papildinājumiem un 4 dzēšanām
  1. 6 4
      src/pages/account/Center/bind/index.tsx

+ 6 - 4
src/pages/account/Center/bind/index.tsx

@@ -39,10 +39,12 @@ const Bind = () => {
     });
   };
   const goRedirect = () => {
-    const url = window.location.href.split('redirect=')?.[1];
-    console.log(url);
-    if (url) {
-      window.location.href = url;
+    const urlParams = new URLSearchParams(window.location.hash);
+    const redirectUrl = urlParams.get('redirect');
+    // const url = window.location.href.split('redirect=')?.[1];
+    console.log(redirectUrl);
+    if (redirectUrl) {
+      window.location.href = redirectUrl;
     }
   };