| | |
| | | } |
| | | |
| | | private loginWithConsultant(): void { |
| | | loginService.logInToConsultant(this.consultantDto).then(res => { |
| | | loginService.logInToConsultant(this.consultantDto, this.verificationCode).then(res => { |
| | | this.getLoginConsultantDetail(this.consultantDto.username); |
| | | this.storageIdToken(res.data.id_token); |
| | | this.storageRole(Role.ADMIN); |
| | |
| | | login() { |
| | | const login: LoginVerify = this.setLoginInfo(); |
| | | this.removeOtpTime(); |
| | | loginService.loginVerify(login).then(res => { |
| | | loginService.loginVerify(login, this.otpCode).then(res => { |
| | | this.storageIdToken(res.id_token); |
| | | this.storageRole(Role.USER); |
| | | this.phoneSuccessConfirmVisable = true; |
| | |
| | | } |
| | | |
| | | /** 顧客登入-驗證OTP **/ |
| | | async loginVerify(loginVerify: LoginVerify):Promise<LoginSuccessToken>{ |
| | | return http.post('/otp/verify', loginVerify).then(res => res.data); |
| | | async loginVerify(loginVerify: LoginVerify, otpCode: string):Promise<LoginSuccessToken>{ |
| | | return http.post(`/otp/verify/${otpCode}`, loginVerify).then(res => res.data); |
| | | } |
| | | |
| | | /** 顧客註冊 **/ |
| | |
| | | } |
| | | |
| | | /** 顧問登入 **/ |
| | | logInToConsultant(consultantDto:ConsultantLoginInfo):Promise<AxiosResponse<LoginSuccessToken>>{ |
| | | return http.post('/eService/authenticate',consultantDto); |
| | | logInToConsultant(consultantDto:ConsultantLoginInfo, verificationCode: string):Promise<AxiosResponse<LoginSuccessToken>>{ |
| | | return http.post(`/eService/authenticate/${verificationCode}`,consultantDto); |
| | | } |
| | | } |
| | | |