|
|
@ -31,7 +31,7 @@ export class LoginComponent implements OnInit { |
|
|
|
this.loginForm = this.form.group({ |
|
|
|
this.loginForm = this.form.group({ |
|
|
|
loginName: [null, [Validators.required]], |
|
|
|
loginName: [null, [Validators.required]], |
|
|
|
password: [null, [Validators.required]], |
|
|
|
password: [null, [Validators.required]], |
|
|
|
vertifyCode: [""]//验证码
|
|
|
|
vertifyCode:[null, [Validators.required]]//验证码
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -40,22 +40,22 @@ export class LoginComponent implements OnInit { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
submitLogin() { |
|
|
|
submitLogin() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// tslint:disable-next-line:forin
|
|
|
|
// tslint:disable-next-line:forin
|
|
|
|
for (const i in this.loginForm.controls) { |
|
|
|
for (const i in this.loginForm.controls) { |
|
|
|
this.loginForm.controls[i].markAsDirty(); |
|
|
|
this.loginForm.controls[i].markAsDirty(); |
|
|
|
this.loginForm.controls[i].updateValueAndValidity(); |
|
|
|
this.loginForm.controls[i].updateValueAndValidity(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.loginForm.status == null || this.loginForm.status !== 'VALID') { |
|
|
|
if (this.loginForm.status == null || this.loginForm.status !== 'VALID') { |
|
|
|
this.modal.warning({ |
|
|
|
// this.modal.warning({
|
|
|
|
nzTitle: '提示', |
|
|
|
// nzTitle: '提示',
|
|
|
|
nzContent: '请填写用户和密码', |
|
|
|
// nzContent: '请填写用户和密码',
|
|
|
|
}); |
|
|
|
// });
|
|
|
|
return; |
|
|
|
return; |
|
|
|
}else if(this.loginForm.value.vertifyCode=="" ||this.loginForm.value.vertifyCode.toLowerCase() !== this.code ){ |
|
|
|
} |
|
|
|
this.modal.warning({ |
|
|
|
if(this.loginForm.value.vertifyCode.toLowerCase() !== this.code ){ |
|
|
|
nzTitle: '提示', |
|
|
|
this.message.error("请填写正确的验证码"); |
|
|
|
nzContent: '请填写正确的验证码', |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -76,7 +76,7 @@ export class LoginComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 子组件验证方法
|
|
|
|
// 子组件验证方法
|
|
|
|
validateFun(str:string){ |
|
|
|
validateFun(str:string) { |
|
|
|
this.code=str |
|
|
|
this.code = str; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|