【fix ESLint】src/views/system
This commit is contained in:
@@ -227,9 +227,7 @@ export default {
|
||||
that.model = Object.assign({}, { selectedroles: '', selecteddeparts: '' }, record)
|
||||
// 身份为上级显示负责部门,否则不显示
|
||||
this.departIdShow = this.model.userIdentity === 2
|
||||
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
if (record.hasOwnProperty('id')) {
|
||||
if (Object.prototype.hasOwnProperty.call(record, 'id')) {
|
||||
that.userId = record.id
|
||||
that.getUserRoles(record.id)
|
||||
that.getUserDeparts(record.id)
|
||||
@@ -386,8 +384,7 @@ export default {
|
||||
const confirmpassword = this.model.confirmpassword
|
||||
|
||||
if (value && confirmpassword && value !== confirmpassword) {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('两次输入的密码不一样!')
|
||||
callback(new Error('两次输入的密码不一样!'))
|
||||
}
|
||||
if (value && this.confirmDirty) {
|
||||
this.$refs.form.validateField(['confirmpassword'])
|
||||
@@ -396,8 +393,7 @@ export default {
|
||||
},
|
||||
compareToFirstPassword (rule, value, callback) {
|
||||
if (value && value !== this.model.password) {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('两次输入的密码不一样!')
|
||||
callback(new Error('两次输入的密码不一样!'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
@@ -417,13 +413,11 @@ export default {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('手机号已存在!')
|
||||
callback(new Error('手机号已存在!'))
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('请输入正确格式的手机号码!')
|
||||
callback(new Error('请输入正确格式的手机号码!'))
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -431,7 +425,6 @@ export default {
|
||||
if (!value) {
|
||||
callback()
|
||||
} else {
|
||||
// eslint-disable-next-line
|
||||
if (new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(value)) {
|
||||
const params = {
|
||||
tableName: 'sys_user',
|
||||
@@ -444,13 +437,11 @@ export default {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('邮箱已存在!')
|
||||
callback(new Error('邮箱已存在!'))
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('请输入正确格式的邮箱!')
|
||||
callback(new Error('请输入正确格式的邮箱!'))
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -465,8 +456,7 @@ export default {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('用户名已存在!')
|
||||
callback(new Error('用户名已存在!'))
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -481,8 +471,7 @@ export default {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('工号已存在!')
|
||||
callback(new Error('工号已存在!'))
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user