From 24847a9ca50716e984d5df628f9977783d4d7589 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期一, 18 七月 2022 23:41:58 +0800 Subject: [PATCH] update: [login] 串接新 API --- PAMapp/pages/consultantLogin/index.vue | 2 +- PAMapp/pages/login/index.vue | 2 +- PAMapp/shared/services/login.service.ts | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PAMapp/pages/consultantLogin/index.vue b/PAMapp/pages/consultantLogin/index.vue index 8289302..421f532 100644 --- a/PAMapp/pages/consultantLogin/index.vue +++ b/PAMapp/pages/consultantLogin/index.vue @@ -153,7 +153,7 @@ } 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); diff --git a/PAMapp/pages/login/index.vue b/PAMapp/pages/login/index.vue index aab6969..b9d611e 100644 --- a/PAMapp/pages/login/index.vue +++ b/PAMapp/pages/login/index.vue @@ -429,7 +429,7 @@ 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; diff --git a/PAMapp/shared/services/login.service.ts b/PAMapp/shared/services/login.service.ts index 26bf0f2..6417777 100644 --- a/PAMapp/shared/services/login.service.ts +++ b/PAMapp/shared/services/login.service.ts @@ -16,8 +16,8 @@ } /** 憿批恥��-撽�TP **/ - 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); } /** 憿批恥閮餃�� **/ @@ -44,8 +44,8 @@ } /** 憿批�� **/ - 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); } } -- Gitblit v1.8.0