|
@@ -215,6 +215,16 @@ export class UserLoginComponent implements OnDestroy, OnInit {
|
|
|
// this.mobile.updateValueAndValidity({ onlySelf: true });
|
|
|
// return;
|
|
|
// }
|
|
|
+ if (this.userName.invalid) {
|
|
|
+ this.userName.markAsDirty({ onlySelf: true });
|
|
|
+ this.userName.updateValueAndValidity({ onlySelf: true });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.password.invalid) {
|
|
|
+ this.password.markAsDirty({ onlySelf: true });
|
|
|
+ this.password.updateValueAndValidity({ onlySelf: true });
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.http
|
|
|
.post('inControlServer/qualityInspection/zhcxApi/sendCode?_allow_anonymous=true', {
|
|
|
account: this.userName.value,
|
|
@@ -262,7 +272,11 @@ export class UserLoginComponent implements OnDestroy, OnInit {
|
|
|
this.userName.updateValueAndValidity();
|
|
|
this.password.markAsDirty();
|
|
|
this.password.updateValueAndValidity();
|
|
|
- if (this.userName.invalid || this.password.invalid) {
|
|
|
+ this.mobile.markAsDirty();
|
|
|
+ this.mobile.updateValueAndValidity();
|
|
|
+ this.captcha.markAsDirty();
|
|
|
+ this.captcha.updateValueAndValidity();
|
|
|
+ if (this.userName.invalid || this.password.invalid || this.mobile.invalid || this.captcha.invalid) {
|
|
|
return;
|
|
|
}
|
|
|
} else {
|