|
|
@@ -246,26 +246,34 @@ export default {
|
|
|
trigger: "change",
|
|
|
validator: (rule, value, callback) => {
|
|
|
if (value) {
|
|
|
- var strength = 0;
|
|
|
- if (value.length >= 12) {
|
|
|
- strength += 1;
|
|
|
- }
|
|
|
- if (/\d{1,}/.test(value)) {
|
|
|
- strength += 1;
|
|
|
- }
|
|
|
- if (/[a-z]{1,}/.test(value)) {
|
|
|
- strength += 1;
|
|
|
- }
|
|
|
- if (/[A-Z]{1,}/.test(value)) {
|
|
|
- strength += 1;
|
|
|
- }
|
|
|
- if (/\W{1,}/.test(value)) {
|
|
|
- strength += 1;
|
|
|
- }
|
|
|
- if (strength>=5) {
|
|
|
- callback()
|
|
|
+ if (settings.enablePassword12) {
|
|
|
+ var strength = 0;
|
|
|
+ if (value.length >= 12) {
|
|
|
+ strength += 1;
|
|
|
+ }
|
|
|
+ if (/\d{1,}/.test(value)) {
|
|
|
+ strength += 1;
|
|
|
+ }
|
|
|
+ if (/[a-z]{1,}/.test(value)) {
|
|
|
+ strength += 1;
|
|
|
+ }
|
|
|
+ if (/[A-Z]{1,}/.test(value)) {
|
|
|
+ strength += 1;
|
|
|
+ }
|
|
|
+ if (/\W{1,}/.test(value)) {
|
|
|
+ strength += 1;
|
|
|
+ }
|
|
|
+ if (strength>=5) {
|
|
|
+ callback()
|
|
|
+ } else {
|
|
|
+ callback("The password is not strength")
|
|
|
+ }
|
|
|
} else {
|
|
|
- callback("The password is not strength")
|
|
|
+ if (value.length < 6) {
|
|
|
+ callback("Password needs to be more than 6 characters")
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
}
|
|
|
} else if (!this.isEdit) {
|
|
|
callback("Passwrod is required")
|