Browse Source

[完善]登录密码验证

beijing
邵佳豪 2 years ago
parent
commit
5aac6f2733
  1. 4
      src/app/pages/login/login.component.ts
  2. 8
      src/theme.less

4
src/app/pages/login/login.component.ts

@ -258,7 +258,7 @@ export class MyValidators extends Validators {
return null; return null;
} }
return isPassword(value) ? null : { mobile: { 'zh-cn': `长度 12 位以上,包含①大写字母、②小写字母、③数字、④特殊字符四种中的三种组合`, en: `Password phone number is not valid` } }; return isPassword(value) ? null : { mobile: { 'zh-cn': `长度至少 8 位,必须包含大写字母、小写字母、数字、符号四种中的三种`, en: `Password phone number is not valid` } };
} }
} }
@ -266,6 +266,6 @@ function isEmptyInputValue(value: NzSafeAny): boolean {
return value == null || value.length === 0; return value == null || value.length === 0;
} }
function isPassword(value: string): boolean { function isPassword(value: string): boolean {
return typeof value === 'string' && /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{12,99}$/.test(value); return typeof value === 'string' && /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{8,99}$/.test(value);
} }

8
src/theme.less

@ -660,6 +660,7 @@
.modelnobg { .modelnobg {
.ant-modal-content { .ant-modal-content {
background: none; background: none;
box-shadow: none
} }
} }
@ -783,8 +784,9 @@
color: #000; color: #000;
} }
} }
.resetPassword{
.ant-notification-close-icon{ .resetPassword {
.ant-notification-close-icon {
color: #000; color: #000;
} }
} }

Loading…
Cancel
Save