保誠-保戶業務員媒合平台
HelenHuang
2021-12-06 9cb6d5f92ad7aeda45ad1fe6482dcfc63d17be2b
PAMapp/pages/consultantLogin/index.vue
@@ -31,8 +31,8 @@
      </div>
      <div class="pam-paragraph">
        <div class="pam-consultant-login__title">
          <div>驗證碼</div>
          <div class="text--dark-blue fs-16 cursor--pointer fix-chrome-click--issue"
          <div>驗證碼 <span class="text--dark-blue fs-16">(區分大小寫)</span></div>
          <div class="text--primary fs-16 cursor--pointer fix-chrome-click--issue"
            @click="regenerateImgOfVerification">重新產生</div>
        </div>
        <div class="pam-consultant-login__verifyBlock mt-10">
@@ -69,7 +69,7 @@
  export default class ConsultantLogin extends Vue {
    @roleStorage.Mutation storageIdToken!: (token: string) => void;
    @roleStorage.Mutation storageRole!: (role: string) => void;
    @roleStorage.Mutation storageConsultantId!:(id:string) => void;
    isRememberUserName = false;
    isShowPassword = false;
    imgSrc = '';
@@ -117,6 +117,7 @@
          this.loginWithConsultant()
        }else{
          this.clearValue();
          this.regenerateImgOfVerification();
          ErrorMessageBox('驗證碼輸入錯誤');
        }
      });
@@ -126,6 +127,7 @@
      logInToConsultant(this.consultantDto).then(res => {
        this.storageIdToken(res.data.id_token);
        this.storageRole(Role.ADMIN);
        this.storageConsultantId(this.consultantDto.username)
        this.storeUserName();
        this.$router.push('/myAppointmentList/appointmentList');
      }).catch((error:AxiosError)=>{
@@ -134,13 +136,15 @@
    }
    private checkHttpErrorStatus(error:any):void{
      this.clearValue();
      this.regenerateImgOfVerification();
      switch (error.response.status) {
        case 401:
          const errorMsg = error.response.data.detail;
          ErrorMessageBox(errorMsg);
          break;
        default:
          ErrorMessageBox();
          ErrorMessageBox('',error);
          break;
      }
    }