保誠-保戶業務員媒合平台
HelenHuang
2022-02-09 d56d1b2b76e5639006c5ce8aaedb5979e74fab70
PAMapp/pages/login/index.vue
@@ -399,7 +399,6 @@
  beforeRouteEnter (to, from, next) {
      next(vm => {
        console.log(from.path, 'beforeRouteEnter');
        vm.previousPath = from.path;
      })
  }
@@ -455,7 +454,7 @@
      this.storageRole(Role.USER);
      this.phoneSuccessConfirmVisable = true;
      this.autoRedirect();
      this.storageUserInfo(this.setRegisterInfo());
      this.storagePhoneOrEmail(this.setRegisterInfo());
    }).catch(error => {
      this.checkHttpErrorStatus(error);
    });
@@ -479,7 +478,7 @@
    loginService.register(registerInfo).then(res => {
      this.storageIdToken(res.id_token);
      this.storageRole(Role.USER);
      this.storageUserInfo(this.setRegisterInfo());
      this.storagePhoneOrEmail(registerInfo);
      this.autoRedirect();
      this.registerSuccessConfirmVisable = true;
    }).catch(() => {
@@ -501,7 +500,6 @@
  private redirect() {
    const backToPrevious = ['questionnaire', 'myConsultantList'];
    const find = backToPrevious.findIndex(item => this.previousPath.includes(item));
    console.log(this.previousPath, find, 'redirect');
    find > -1 ? this.$router.go(-1) : this.$router.push('/');
  }
@@ -637,6 +635,13 @@
      }
  }
  private storagePhoneOrEmail(registerInfo:RegisterInfo):void{
    const info = {...registerInfo, time: new Date()}
  // storageUserInfo!: (userInfo: RegisterInfo) => void;
    this.storageUserInfo(info);
    // localStorage.setItem('userInfo',JSON.stringify(info));
  }
  private removeOtpTime() {
    otpService.removeOtpTimeToStorage(OtpStorageName.PHONE);
    otpService.removeOtpTimeToStorage(OtpStorageName.EMAIL);