forked from github/cool-admin-java
fix: 空字符串转null避免唯一索引冲突
This commit is contained in:
@@ -43,6 +43,15 @@ public class AdminUserInfoController extends BaseController<UserInfoService, Use
|
||||
protected R update(@RequestBody UserInfoEntity t, @RequestAttribute JSONObject requestParams) {
|
||||
Long id = t.getId();
|
||||
if (id != null) {
|
||||
if (t.getPhone() != null && t.getPhone().isEmpty()) {
|
||||
t.setPhone(null);
|
||||
}
|
||||
if (t.getUsername() != null && t.getUsername().isEmpty()) {
|
||||
t.setUsername(null);
|
||||
}
|
||||
if (t.getEmail() != null && t.getEmail().isEmpty()) {
|
||||
t.setEmail(null);
|
||||
}
|
||||
UserInfoEntity before = userInfoService.getById(id);
|
||||
if (before != null) {
|
||||
if (!ObjUtil.equals(before.getStatus(), t.getStatus())) {
|
||||
|
||||
Reference in New Issue
Block a user