From 0e556314c63ce6647c8e09208d60922590144922 Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期三, 30 九月 2026 15:24:31 +0800
Subject: [PATCH] fix(auth): 修复生产 hash 路由下社交登录/绑定回跳不跳转

---
 src/views/_core/profile/modules/user-social.vue |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/views/_core/profile/modules/user-social.vue b/src/views/_core/profile/modules/user-social.vue
index d0925ba..4c96f99 100644
--- a/src/views/_core/profile/modules/user-social.vue
+++ b/src/views/_core/profile/modules/user-social.vue
@@ -122,7 +122,9 @@
   try {
     // 璁$畻 redirectUri
     // tricky: type 闇�瑕佸厛 encode 涓�娆★紝鍚﹀垯閽夐拤鍥炶皟浼氫涪澶便�傞厤鍚� getUrlValue() 浣跨敤
-    const redirectUri = `${location.origin}/profile?${encodeURIComponent(`type=${type}`)}`;
+    // hash 璺敱锛堢敓浜ф瀯寤猴級涓嬪繀椤诲甫 # 鍓嶇紑锛屽惁鍒欏洖璺冲悗 vue-router 瑙f瀽鍒� /锛岃繘涓嶄簡缁戝畾娴佺▼
+    const hashPrefix = import.meta.env.VITE_ROUTER_HISTORY === 'hash' ? '/#' : '';
+    const redirectUri = `${location.origin}${hashPrefix}/profile?${encodeURIComponent(`type=${type}`)}`;
 
     // 杩涜璺宠浆
     window.location.href = await socialAuthRedirect(type, redirectUri);

--
Gitblit v1.9.3