|
@@ -5,8 +5,8 @@
|
|
|
<el-input v-show="false" v-model="user.avatar" />
|
|
|
<upload-image tip="建议尺寸:60 * 60px" />
|
|
|
</el-form-item> -->
|
|
|
- <el-form-item label="登录名:" prop="username">
|
|
|
- <el-input v-model="userInfo.username" :placeholder="`通过登录名登录时请加上前缀,例如:${prefix}_test`">
|
|
|
+ <el-form-item label="登录名:" prop="loginAccount">
|
|
|
+ <el-input v-model="userInfo.loginAccount" :placeholder="`通过登录名登录时请加上前缀,例如:${prefix}_test`">
|
|
|
<template slot="prepend">{{ prefix }}_</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
@@ -79,7 +79,7 @@ export default {
|
|
|
editType: 'add',
|
|
|
userInfo: {
|
|
|
id: 0,
|
|
|
- username: '',
|
|
|
+ loginAccount: '',
|
|
|
password: '',
|
|
|
linkMan: '',
|
|
|
mobile: '',
|
|
@@ -89,7 +89,7 @@ export default {
|
|
|
},
|
|
|
roleList: [],
|
|
|
rules: {
|
|
|
- username: [
|
|
|
+ loginAccount: [
|
|
|
{ required: true, message: '登录名不能为空', trigger: 'blur' },
|
|
|
{ min: 2, max: 15, message: '长度在 2 到 15 个字符', trigger: 'blur' }
|
|
|
],
|
|
@@ -125,7 +125,7 @@ export default {
|
|
|
updateUserInfo() {
|
|
|
const userInfo = deepClone(this.userInfo)
|
|
|
userInfo.roleIds = userInfo.roleList.join(',')
|
|
|
- userInfo.username = `${this.prefix}_${userInfo.username}`
|
|
|
+ userInfo.loginAccount = `${this.prefix}_${userInfo.loginAccount}`
|
|
|
updateUser(userInfo.id, userInfo).then((res) => {
|
|
|
this.$message.success('修改用户成功')
|
|
|
this.$store.dispatch('tagsView/delView', this.$route)
|
|
@@ -136,7 +136,7 @@ export default {
|
|
|
createUserInfo() {
|
|
|
const userInfo = deepClone(this.userInfo)
|
|
|
userInfo.roleIds = userInfo.roleList.join(',')
|
|
|
- userInfo.username = `${this.prefix}_${userInfo.username}`
|
|
|
+ userInfo.loginAccount = `${this.prefix}_${userInfo.loginAccount}`
|
|
|
createUser(userInfo).then((res) => {
|
|
|
this.$message.success('添加用户成功')
|
|
|
this.$store.dispatch('tagsView/delView', this.$route)
|
|
@@ -169,8 +169,8 @@ export default {
|
|
|
}
|
|
|
const prefix = this.prefix + '_'
|
|
|
const prefixLen = prefix.length
|
|
|
- if (this.userInfo.username.startsWith(prefix)) {
|
|
|
- this.userInfo.username = this.userInfo.username.substring(prefixLen)
|
|
|
+ if (this.userInfo.loginAccount.startsWith(prefix)) {
|
|
|
+ this.userInfo.loginAccount = this.userInfo.loginAccount.substring(prefixLen)
|
|
|
}
|
|
|
this.userInfo.roleList = data.roleIds.split(',').map((item) => parseInt(item))
|
|
|
},
|