| | |
| | | wxcpLoading.value = true; |
| | | // 注意:type 需要先 encode 一次,配合 social-login 页面的 getUrlValue() 使用; |
| | | // 否则企业微信回跳后 type 参数会被吞掉,导致无法识别社交类型 |
| | | const redirectUri = `${location.origin}/auth/social-login?${encodeURIComponent( |
| | | // 回调地址必须带 hash 前缀:生产用 hash 路由(VITE_ROUTER_HISTORY=hash), |
| | | // 少了 # 企业微信回跳后 vue-router 会解析到 /,落到登录页而不是 social-login 页面 |
| | | const hashPrefix = |
| | | import.meta.env.VITE_ROUTER_HISTORY === 'hash' ? '/#' : ''; |
| | | const redirectUri = `${location.origin}${hashPrefix}/auth/social-login?${encodeURIComponent( |
| | | `type=${WXCP_SOCIAL_TYPE}`, |
| | | )}`; |
| | | window.location.href = await socialAuthRedirect( |