diff --git a/src/app/pages/change-password/change-password.component.ts b/src/app/pages/change-password/change-password.component.ts index 62d64b3..7eae4fb 100644 --- a/src/app/pages/change-password/change-password.component.ts +++ b/src/app/pages/change-password/change-password.component.ts @@ -33,7 +33,7 @@ export class MyValidators extends Validators { 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 位,必须包含大写字母、小写字母、数字、符号四种中的三种,且口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符`, en: `Password phone number is not valid` } }; } } @@ -41,5 +41,5 @@ function isEmptyInputValue(value: NzSafeAny): boolean { return value == null || value.length === 0; } 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_!@#$%^&*`~()-+=]+$)(?!.*[sS][iI][nN][oO].*)(?!.*[zZ][hH][oO][nN][gG][hH][uU][aA].*)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{8,99}$/.test(value); } diff --git a/src/app/pages/home/home.component.ts b/src/app/pages/home/home.component.ts index b47ae15..ff44efa 100644 --- a/src/app/pages/home/home.component.ts +++ b/src/app/pages/home/home.component.ts @@ -503,13 +503,12 @@ export class HomeComponent implements OnInit { } } } - // this.router.navigate([this.menuList2[0].url]) - if (this.menuList2[0].url) { - window.open(this.menuList2[0].url) - } else { + if (this.menuList2.length == 0) { this.message.create('warning', '未分配系统管理菜单'); + return + } else { + window.open(this.menuList2[0].url) } - } goback() { this.router.navigate(['/plan']) @@ -568,10 +567,14 @@ export class HomeComponent implements OnInit { nzComponentParams: {}, nzOnOk: async () => { if (instance.validateForm.valid) { + let word = JSON.parse(JSON.stringify(instance.validateForm.value.newpassword)).toLowerCase() if (instance.validateForm.value.newpassword != instance.validateForm.value.affirmpassword) { this.message.create('warning', '两次密码输入不一致!'); return false - } else { + } if (word.indexOf('sino') != -1 || word.indexOf('zhonghua') != -1) { + this.message.create('warning', '口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符'); + return false + } else { await new Promise((resolve, reject) => { let body = { currentPassword: instance.validateForm.value.oldpassword, diff --git a/src/app/pages/login/forget/forget.component.html b/src/app/pages/login/forget/forget.component.html index ef2d29f..de98eb1 100644 --- a/src/app/pages/login/forget/forget.component.html +++ b/src/app/pages/login/forget/forget.component.html @@ -14,7 +14,8 @@