保誠-保戶業務員媒合平台
Mila
2021-12-29 c1530925a40261cbd4b66ea77114a1407f00930c
[ Ref ] refactor page: consultantLogin
修改1個檔案
49 ■■■■■ 已變更過的檔案
PAMapp/pages/consultantLogin/index.vue 49 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/consultantLogin/index.vue
@@ -67,30 +67,42 @@
    layout: 'home'
  })
  export default class ConsultantLogin extends Vue {
    @roleStorage.Mutation storageIdToken!: (token: string) => void;
    @roleStorage.Mutation storageRole!: (role: string) => void;
    @roleStorage.Mutation storageConsultantId!:(id:string) => void;
    @roleStorage.Mutation
    storageIdToken!: (token: string) => void;
    @roleStorage.Mutation
    storageRole!: (role: string) => void;
    @roleStorage.Mutation
    storageConsultantId!:(id:string) => void;
    consultantDto = {
      password: '',
      username: '',
    };
    imgSrc = '';
    isRememberUserName = false;
    isShowPassword = false;
    imgSrc = '';
    verificationCode='';
    consultantDto = {
      username: '',
      password: '',
    }
    ////////////////////////////////////////////////////////////////////
    mounted() {
      this.getInitUserName();
      this.regenerateImgOfVerification();
    };
    get isAlreadyDone():boolean{
      return !!(this.verificationCode && this.consultantDto.username && this.consultantDto.password);
    private getInitUserName(): void {
      const username = localStorage.getItem('consultantUserName')
      if (username) {
        this.consultantDto.username = username;
        this.isRememberUserName = true;
      }
    }
    ////////////////////////////////////////////////////////////////////
    public regenerateImgOfVerification(): void {
      loginService.getImgOfVerification().then( imgOfBase64 =>
        this.imgSrc = imgOfBase64
@@ -103,18 +115,17 @@
    }
    public sendInfo():void{
      this.isAlreadyDone ? this.verify() : messageBoxService.showErrorMessage('請確認帳號、密碼以及驗證碼是否填寫完畢');
      this.isAlreadyDone
        ? this.verify()
        : messageBoxService.showErrorMessage('請確認帳號、密碼以及驗證碼是否填寫完畢');
    }
    get isAlreadyDone():boolean{
      return !!(this.verificationCode && this.consultantDto.username && this.consultantDto.password);
    }
    ////////////////////////////////////////////////////////////////////
    private getInitUserName(): void {
      const username = localStorage.getItem('consultantUserName')
      if (username) {
        this.consultantDto.username = username;
        this.isRememberUserName = true;
      }
    }
    private verify():void{
      loginService.getVerificationStatus(this.verificationCode).then( verifySuccess => {