|
|
@@ -3,6 +3,7 @@
|
|
|
class="dialog-access"
|
|
|
:visible="visible"
|
|
|
:before-close="e => hideDialog(false)"
|
|
|
+ :close-on-click-modal="false"
|
|
|
:title="isEdit ? 'Update User' : 'Add User'">
|
|
|
<el-form
|
|
|
ref="acsForm"
|
|
|
@@ -70,23 +71,22 @@
|
|
|
<el-form-item
|
|
|
class="form-item"
|
|
|
label="SET PASSWORD:"
|
|
|
- v-if="isEdit">
|
|
|
- <el-input
|
|
|
- v-model="form.password"
|
|
|
- class="flex-item"
|
|
|
- type="password"
|
|
|
- maxlength="32"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- class="form-item"
|
|
|
- label="SET PASSWORD:"
|
|
|
- prop="password"
|
|
|
- v-else>
|
|
|
+ prop="password">
|
|
|
<el-input
|
|
|
v-model="form.password"
|
|
|
class="flex-item"
|
|
|
type="password"
|
|
|
maxlength="32"/>
|
|
|
+ <template slot="label">
|
|
|
+ SET PASSWORD:
|
|
|
+ <el-tooltip
|
|
|
+ effect="dark"
|
|
|
+ :content="passwordTips"
|
|
|
+ placement="top"
|
|
|
+ popper-class="access-password-strength-tips">
|
|
|
+ <i class="el-icon-info"/>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="form-row">
|
|
|
@@ -241,9 +241,38 @@ export default {
|
|
|
trigger: "change"
|
|
|
}],
|
|
|
password: [{
|
|
|
- required: true,
|
|
|
- message: "Passwrod is required",
|
|
|
- trigger: "blur"
|
|
|
+ required: false,
|
|
|
+ //message: "Passwrod is required",
|
|
|
+ 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()
|
|
|
+ } else {
|
|
|
+ callback("The password is not strength")
|
|
|
+ }
|
|
|
+ } else if (!this.isEdit) {
|
|
|
+ callback("Passwrod is required")
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }
|
|
|
}],
|
|
|
providerPk: {
|
|
|
required: true,
|
|
|
@@ -265,7 +294,8 @@ export default {
|
|
|
siteOptions: [],
|
|
|
groupOptions: [],
|
|
|
callingOptions: [],
|
|
|
- providerOptions: []
|
|
|
+ providerOptions: [],
|
|
|
+ passwordTips: "Passwords must be at least 12 characters long and include a combination of uppercase and lowercase letters, numbers, and special characters (e.g., !, @, #, $)"
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -471,4 +501,9 @@ export default {
|
|
|
max-width: none;
|
|
|
}
|
|
|
}
|
|
|
+</style>
|
|
|
+<style>
|
|
|
+.access-password-strength-tips {
|
|
|
+ max-width: 270px;
|
|
|
+}
|
|
|
</style>
|