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 解析到 /,进不了绑定流程 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);