|
|
@@ -345,15 +345,15 @@ export default {
|
|
|
thatForm.validateField("password", v2 => {
|
|
|
if (!v1 && !v2) {
|
|
|
if (this.cardVerified) {
|
|
|
- // 1. Parse URL for 'from' parameter
|
|
|
+ // 1. Parse URL for "from" parameter
|
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
|
const from = urlParams.get("from");
|
|
|
- // 2. Set redirect_uri cookie if 'from' exists
|
|
|
+ // 2. Set redirect_uri cookie if "from" exists
|
|
|
if (from) {
|
|
|
document.cookie = `redirect_uri=${encodeURIComponent(from)}; path=/; max-age=300`;
|
|
|
- console.log('设置redirect_uri cookie:', from);
|
|
|
+ console.log("设置redirect_uri cookie:", from);
|
|
|
} else {
|
|
|
- console.log('URL中没有from参数');
|
|
|
+ console.log("URL中没有from参数");
|
|
|
}
|
|
|
const params = {
|
|
|
phone: this.cardForm.phone,
|
|
|
@@ -361,14 +361,14 @@ export default {
|
|
|
};
|
|
|
this.$apis.loginAPI(params)
|
|
|
.then((res) => {
|
|
|
- console.log('登录响应:', res.data.data);
|
|
|
+ console.log("登录响应:", res.data.data);
|
|
|
if (res.data.code === 0) {
|
|
|
// 清理redirect_uri cookie
|
|
|
setCookie({redirect_uri: ""}, -1);
|
|
|
|
|
|
// 检查是否需要重定向
|
|
|
- if (res.data.data.redirectUri && res.data.data.redirectUri.trim() !== '') {
|
|
|
- console.log('准备重定向到:', res.data.data.redirectUri);
|
|
|
+ if (res.data.data.redirectUri && res.data.data.redirectUri.trim() !== "") {
|
|
|
+ console.log("准备重定向到:", res.data.data.redirectUri);
|
|
|
// 跳转到外部系统的home页面,并携带token
|
|
|
if(res.data.data.redirectUri === REQUEST_BASE_URL_EAI) {
|
|
|
window.location.href = `${res.data.data.redirectUri}/home?token=${encodeURIComponent(res.data.data.token)}`;
|