diff --git a/src/app/routes/passport/components/login/login.component.ts b/src/app/routes/passport/components/login/login.component.ts index b294f539..23a21c73 100644 --- a/src/app/routes/passport/components/login/login.component.ts +++ b/src/app/routes/passport/components/login/login.component.ts @@ -188,11 +188,9 @@ export class UserLoginComponent implements OnInit, OnDestroy { if (!this.captchaSF.valid) { return; } - // this.userSrv.loginByCaptcha(this.captchaSF.value.phone, this.captchaSF.value.smsCode, this.captchaSF.value.sc); + this.userSrv.loginByMobile(this.captchaSF.value.phone, this.captchaSF.value.smsCode, this.captchaSF.value.sc); } else { this.accountSF.validator({ emitError: true }); - console.log(this.accountSF.value); - if (!this.accountSF.valid) { return; } diff --git a/src/app/shared/services/business/user.service.ts b/src/app/shared/services/business/user.service.ts index 06b257b0..0fee00cb 100644 --- a/src/app/shared/services/business/user.service.ts +++ b/src/app/shared/services/business/user.service.ts @@ -29,7 +29,7 @@ export class EAUserService extends BaseService { /** * 手机号登录 */ - $api_login_by_mobile = `/scce/cuc/cuc/user/sms/login?_allow_anonymous=true`; + $api_login_by_mobile = `/api/mdc/cuc/user/sms/login?_allow_anonymous=true`; // 登录路径 private $api_login = `/scce/cuc/cuc/user/login?_allow_anonymous=true`; private $api_captcha_login = `/scce/cuc/cuc/user/sms/login?_allow_anonymous=true`; @@ -99,10 +99,10 @@ export class EAUserService extends BaseService { loginByMobile(mobile: string, captcha: string, sc: string) { this.asyncRequest(this.$api_login_by_mobile, { phone: mobile, smsCode: captcha, sc }, 'POST', true, 'FORM').then((res) => { if (res?.token) { - this.cacheSrv.set(cacheConf.token, res.token); + // this.cacheSrv.set(cacheConf.token, res.token); + this.tokenSrv.set({ token: res.token }); this.doAfterLogin(); - // this.eventSrv.event.emit(eventConf.reflesh_login_status); - this.router.navigate([this.ar.snapshot.queryParams.returnUrl || '/']); + this.router.navigate(['/']); } }); } @@ -117,8 +117,7 @@ export class EAUserService extends BaseService { if (res?.token) { this.tokenSrv.set({ token: res.token }); this.doAfterLogin(); - this.router.navigate([this.ar.snapshot.queryParams.returnUrl || '/']); - // this.eventSrv.event.emit(eventConf.reflesh_login_status, this.ar.snapshot.queryParams.returnUrl || '/'); + this.router.navigate(['/']); } }); }