| | |
| | | import { namespace } from 'nuxt-property-decorator'; |
| | | import { Vue, Component, Ref } from 'vue-property-decorator'; |
| | | import { LoginRequest, LoginVerify, loginVerify, OtpInfo, register, RegisterInfo, sendOtp } from '~/assets/ts/api/consultant'; |
| | | import ErrorMessageBox from '~/assets/ts/errorService'; |
| | | import { Role } from '~/assets/ts/models/enum/Role'; |
| | | |
| | | const roleStorage = namespace('localStorage'); |
| | |
| | | get phoneCounter() { |
| | | let min = Math.floor(this.otpCounterSec / 60); |
| | | let sec = Math.floor(this.otpCounterSec % 60); |
| | | return `${min < 10 ? '0' + min : min} : ${sec < 10 ? '0' + sec : sec}`; |
| | | return `${min < 10 ? '0' + min : min}:${sec < 10 ? '0' + sec : sec}`; |
| | | } |
| | | |
| | | get emailOtpCounter() { |
| | | let min = Math.floor(this.emailCounterSec / 60); |
| | | let sec = Math.floor(this.emailCounterSec % 60); |
| | | return `${min < 10 ? '0' + min : min} : ${sec < 10 ? '0' + sec : sec}`; |
| | | return `${min < 10 ? '0' + min : min}:${sec < 10 ? '0' + sec : sec}`; |
| | | } |
| | | |
| | | get showPhoneOtpCodeField(): boolean { |
| | |
| | | this.phoneSuccessConfirmVisable = true; |
| | | this.storagePhoneOrEmail(this.setRegisterInfo()); |
| | | }).catch(error => { |
| | | if (error.response.status === 401) { |
| | | this.registerDialogVisible = true; |
| | | setTimeout(() => { |
| | | const isScrollBarNeedless = this.contract.scrollHeight <= this.contract.clientHeight; |
| | | if (isScrollBarNeedless) { |
| | | this.isReadContract = true; |
| | | } |
| | | }, 1000); |
| | | this.checkHttpErrorStatus(error); |
| | | }); |
| | | } |
| | | private checkHttpErrorStatus(error:any):void{ |
| | | switch (error.response.status) { |
| | | case 401: |
| | | ErrorMessageBox('',error); |
| | | break; |
| | | case 403: |
| | | this.registerDialogVisible = true; |
| | | setTimeout(() => { |
| | | const isScrollBarNeedless = this.contract.scrollHeight <= this.contract.clientHeight; |
| | | if (isScrollBarNeedless) { |
| | | this.isReadContract = true; |
| | | } |
| | | }, 1000); |
| | | break; |
| | | default: |
| | | ErrorMessageBox('',error); |
| | | break; |
| | | } |
| | | }) |
| | | } |
| | | |
| | | destroyed() { |