fix: 当用户名没有被修改时, 忽略修改操作
This commit is contained in:
@@ -115,6 +115,7 @@ export default class User {
|
|||||||
return this.bean.username
|
return this.bean.username
|
||||||
}
|
}
|
||||||
setUserName(userName: string) {
|
setUserName(userName: string) {
|
||||||
|
if (this.getUserName() == userName) return
|
||||||
if (User.findAllBeansByCondition('username = ?', userName).length > 0)
|
if (User.findAllBeansByCondition('username = ?', userName).length > 0)
|
||||||
throw new DataWrongError(`用户名 ${userName} 已存在`)
|
throw new DataWrongError(`用户名 ${userName} 已存在`)
|
||||||
this.setAttr("username", userName)
|
this.setAttr("username", userName)
|
||||||
|
|||||||
Reference in New Issue
Block a user