代码更新
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package org.nl.modules.system.rest;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -110,7 +111,10 @@ public class UserController {
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody User resources){
|
||||
checkLevel(resources);
|
||||
// 默认密码 123456
|
||||
resources.setPassword(passwordEncoder.encode("123456"));
|
||||
if (ObjectUtil.isEmpty(resources.getPassword()))
|
||||
resources.setPassword(passwordEncoder.encode("123456"));
|
||||
else
|
||||
resources.setPassword(passwordEncoder.encode(resources.getPassword()));
|
||||
userService.create(resources);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user