浏览代码

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

xieyonghong 3 年之前
父节点
当前提交
0f00126fe4
共有 1 个文件被更改,包括 6 次插入4 次删除
  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;
     }
   };