手机登录
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
@ -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(['/']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user