Browse Source

Password verification and v-for add key (#1440)

pull/2/head
break60 5 years ago committed by qiaozhanwei
parent
commit
446adb2485
  1. 2
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskCtatusCount.vue
  2. 21
      dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/createUser.vue
  3. 26
      dolphinscheduler-ui/src/js/conf/home/pages/user/pages/password/_source/info.vue
  4. 2
      dolphinscheduler-ui/src/js/module/components/nav/nav.vue
  5. 2
      dolphinscheduler-ui/src/js/module/components/secondaryMenu/secondaryMenu.vue
  6. 4
      dolphinscheduler-ui/src/js/module/components/transfer/resource.vue
  7. 1
      dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
  8. 1
      dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

2
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskCtatusCount.vue

@ -29,7 +29,7 @@
<th>{{$t('Number')}}</th>
<th>{{$t('State')}}</th>
</tr>
<tr v-for="(item,$index) in taskCtatusList">
<tr v-for="(item,$index) in taskCtatusList" :key="$index">
<td><span>{{$index+1}}</span></td>
<td>
<span>

21
dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/createUser.vue

@ -151,16 +151,26 @@
// Mobile phone number regular
let regPhone = /^1(3|4|5|6|7|8)\d{9}$/; // eslint-disable-line
let regPassword = /^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?![`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]+$)[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、0-9A-Za-z]{6,22}$/;
// user name
if (!this.userName.replace(/\s*/g,"")) {
this.$message.warning(`${i18n.$t('Please enter user name')}`)
return false
}
// password
if (!this.userPassword && !this.item) {
this.$message.warning(`${i18n.$t('Please enter your password')}`)
if (this.userPassword!='' && this.item) {
if(!regPassword.test(this.userPassword)) {
this.$message.warning(`${i18n.$t('Password consists of at least two combinations of numbers, letters, and characters, and the length is between 6-22')}`)
return false
}
} else if(!this.item){
if(!regPassword.test(this.userPassword)) {
this.$message.warning(`${i18n.$t('Password consists of at least two combinations of numbers, letters, and characters, and the length is between 6-22')}`)
return false
}
}
// email
if (!this.email) {
this.$message.warning(`${i18n.$t('Please enter email')}`)
@ -184,6 +194,7 @@
_getQueueList () {
return new Promise((resolve, reject) => {
this.store.dispatch('security/getQueueList').then(res => {
this.queueList = _.map(res, v => {
return {
id: v.id,
@ -223,7 +234,7 @@
userPassword: this.userPassword,
tenantId: this.tenantId,
email: this.email,
queue: this.queueList[this.queueName].code,
queue: this.queueList.length>0? _.find(this.queueList, ['id', this.queueName]).code : '',
phone: this.phone
}
@ -266,7 +277,11 @@
this.email = this.item.email
this.phone = this.item.phone
this.tenantId = this.item.tenantId
if(this.queueList.length>0) {
this.queueName = _.find(this.queueList, ['code', this.item.queue]).id
} else {
this.queueName = ''
}
}
}
},

26
dolphinscheduler-ui/src/js/conf/home/pages/user/pages/password/_source/info.vue

@ -104,35 +104,15 @@
* verification
*/
_verification () {
let regCn = new RegExp('[\\u4E00-\\u9FFF]+', 'g')
let regPassword = /^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?![`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]+$)[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、0-9A-Za-z]{6,22}$/;
// password
if (regCn.test(this.userPassword)) {
this.$message.warning(`${i18n.$t('Password cannot be in Chinese')}`)
return false
}
if (!this.userPassword) {
this.$message.warning(`${i18n.$t('Please enter a password (6-22) character password')}`)
return false
}
if (this.userPassword.length < 6 || this.userPassword.length > 22) {
this.$message.warning(`${i18n.$t('Please enter a password (6-22) character password')}`)
if (!regPassword.test(this.userPassword)) {
this.$message.warning(`${i18n.$t('Password consists of at least two combinations of numbers, letters, and characters, and the length is between 6-22')}`)
return false
}
// confirm password
if (regCn.test(this.oldUserPassword)) {
this.$message.warning(`${i18n.$t('Confirmation password cannot be in Chinese')}`)
return false
}
if (!this.oldUserPassword) {
this.$message.warning(`${i18n.$t('Please enter a confirmation password (6-22) character password')}`)
return false
}
if (this.oldUserPassword.length < 6 || this.oldUserPassword.length > 22) {
this.$message.warning(`${i18n.$t('Please enter a confirmation password (6-22) character password')}`)
return false
}
if (this.userPassword !== this.oldUserPassword) {
this.$message.warning(`${i18n.$t('The password is inconsistent with the confirmation password')}`)
return false

2
dolphinscheduler-ui/src/js/module/components/nav/nav.vue

@ -72,7 +72,7 @@
style="width: 80px"
trigger="click">
<div class="lrns-list">
<a href="javascript:" @click="_toggleLanguage(item.code)" v-for="(item,$index) in localeList"><span>{{item.name}}</span></a>
<a href="javascript:" @click="_toggleLanguage(item.code)" v-for="(item,$index) in localeList" :key="$index"><span>{{item.name}}</span></a>
</div>
<div class="login-model" slot="reference">
<span>{{activeLocale.name}}</span>

2
dolphinscheduler-ui/src/js/module/components/secondaryMenu/secondaryMenu.vue

@ -20,7 +20,7 @@
<a href="javascript:" class="tog-close" @click="_toggleMenu" v-if="!isTogHide"></a>
<a href="javascript:" class="tog-open" @click="_toggleMenu" v-if="isTogHide"></a>
</div>
<div class="leven-1" v-for="(item,$index) in menuList">
<div class="leven-1" v-for="(item,$index) in menuList" :key="$index">
<div v-if="item.disabled">
<template v-if="item.path">
<router-link :to="{ name: item.path}">

4
dolphinscheduler-ui/src/js/module/components/transfer/resource.vue

@ -42,7 +42,7 @@
</div>-->
<div class="scrollbar tf-content">
<ul>
<li v-for="(item,$index) in sourceList" :key="item.id" @click="_ckSource(item)">
<li v-for="(item,$index) in sourceList" :key="$index" @click="_ckSource(item)">
<span :title="item.name">{{item.name}}</span>
<a href="javascript:"></a>
</li>
@ -68,7 +68,7 @@
</div>-->
<div class="scrollbar tf-content">
<ul>
<li v-for="(item,$index) in targetList" :key="item.id" @click="_ckTarget(item)"><span :title="item.name">{{item.name}}</span></li>
<li v-for="(item,$index) in targetList" :key="$index" @click="_ckTarget(item)"><span :title="item.name">{{item.name}}</span></li>
</ul>
</div>
</div>

1
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js

@ -20,6 +20,7 @@ export default {
'Please enter user name': 'Please enter user name',
'Password': 'Password',
'Please enter your password': 'Please enter your password',
'Password consists of at least two combinations of numbers, letters, and characters, and the length is between 6-22': 'Password consists of at least two combinations of numbers, letters, and characters, and the length is between 6-22',
'Login': 'Login',
'Home': 'Home',
'Failed to create node to save': 'Failed to create node to save',

1
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

@ -20,6 +20,7 @@ export default {
'Please enter user name': '请输入用户名',
'Password': '密码',
'Please enter your password': '请输入密码',
'Password consists of at least two combinations of numbers, letters, and characters, and the length is between 6-22': '密码至少包含数字字母和字符的两种组合长度在6-22之间',
'Login': '登录',
'Home': '首页',
'Failed to create node to save': '未创建节点保存失败',

Loading…
Cancel
Save