From c318d2804402e8fd4550c45dd55490dc20a5c514 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Tue, 10 Jan 2023 15:34:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=89=E6=96=B9=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 1 + src/views/account/Center/bind/index.vue | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/components.d.ts b/components.d.ts index aca97d61..c64325c2 100644 --- a/components.d.ts +++ b/components.d.ts @@ -34,6 +34,7 @@ declare module '@vue/runtime-core' { PermissionButton: typeof import('./src/components/PermissionButton/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + TitleComponent: typeof import('./src/components/TitleComponent/index.vue')['default'] ValueItem: typeof import('./src/components/ValueItem/index.vue')['default'] } } diff --git a/src/views/account/Center/bind/index.vue b/src/views/account/Center/bind/index.vue index 459e9ebc..2f134ab1 100644 --- a/src/views/account/Center/bind/index.vue +++ b/src/views/account/Center/bind/index.vue @@ -171,6 +171,21 @@ const handleSubmit = () => { console.log('error', err); }); }; + +/** + * 绑定成功跳转至页面url的: redirect + */ +const goRedirect = () => { + const urlParams = new URLSearchParams(window.location.hash); + const redirectUrl = + urlParams.get('redirect') || + window.location.href.split('redirect=')?.[1]; + console.log('redirectUrl: ', redirectUrl); + //内部集成需要跳回它们页面 + if (redirectUrl && redirectUrl.indexOf('account/center/bind') === -1) { + window.location.href = decodeURIComponent(redirectUrl); + } +};