| | |
| | | @roleStorage.Mutation |
| | | storageRole!: (role:string) => void; |
| | | |
| | | @roleStorage.Mutation |
| | | storageUserInfo!: (userInfo: RegisterInfo) => void; |
| | | |
| | | @Ref('contract') readonly contract!: any; |
| | | |
| | | connectDevice: 'MOBILE' | 'EMAIL' = 'MOBILE'; |
| | |
| | | this.storageRole(Role.USER); |
| | | this.phoneSuccessConfirmVisable = true; |
| | | this.autoRedirect(); |
| | | this.storagePhoneOrEmail(this.setRegisterInfo()); |
| | | this.storageUserInfo(this.setRegisterInfo()); |
| | | }).catch(error => { |
| | | this.checkHttpErrorStatus(error); |
| | | }); |
| | |
| | | loginService.register(registerInfo).then(res => { |
| | | this.storageIdToken(res.id_token); |
| | | this.storageRole(Role.USER); |
| | | this.storagePhoneOrEmail(registerInfo); |
| | | this.storageUserInfo(this.setRegisterInfo()); |
| | | this.autoRedirect(); |
| | | this.registerSuccessConfirmVisable = true; |
| | | }).catch(() => { |
| | |
| | | messageBoxService.showErrorMessage('',error); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private storagePhoneOrEmail(registerInfo:RegisterInfo):void{ |
| | | const info = {...registerInfo, time: new Date()} |
| | | localStorage.setItem('userInfo',JSON.stringify(info)); |
| | | } |
| | | |
| | | private removeOtpTime() { |