|
@@ -7,28 +7,22 @@ package org.eco.vip.nexus.core.controller.user;
|
|
|
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
-import cn.hutool.crypto.digest.BCrypt;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import jakarta.validation.Valid;
|
|
|
import jakarta.validation.constraints.NotEmpty;
|
|
|
-import org.eco.vip.nexus.core.domain.auth.pojo.LoginUserVO;
|
|
|
-import org.eco.vip.nexus.core.domain.user.pojo.UserBO;
|
|
|
-import org.eco.vip.nexus.core.domain.user.pojo.UserVO;
|
|
|
-import org.eco.vip.nexus.core.service.user.IUserService;
|
|
|
import org.eco.vip.core.pojo.CommonResult;
|
|
|
import org.eco.vip.core.pojo.LoginUserStorage;
|
|
|
import org.eco.vip.core.pojo.PageResult;
|
|
|
import org.eco.vip.core.utils.ObjUtils;
|
|
|
import org.eco.vip.core.utils.StrUtils;
|
|
|
+import org.eco.vip.nexus.core.domain.auth.pojo.LoginUserVO;
|
|
|
+import org.eco.vip.nexus.core.domain.user.pojo.UserBO;
|
|
|
+import org.eco.vip.nexus.core.domain.user.pojo.UserVO;
|
|
|
+import org.eco.vip.nexus.core.service.user.IUserService;
|
|
|
import org.eco.vip.security.annotation.PermissionsResource;
|
|
|
import org.eco.vip.security.utils.LoginHelper;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@@ -63,7 +57,6 @@ public class UserController {
|
|
|
@PostMapping("/add")
|
|
|
@SaCheckPermission("system:user:add")
|
|
|
public CommonResult<String> add(@RequestBody @Valid UserBO userBO) {
|
|
|
- userBO.setPassword(BCrypt.hashpw(userBO.getPassword()));
|
|
|
boolean result = userService.insert(userBO);
|
|
|
if (!result) {
|
|
|
return fail("新增用户失败!");
|
|
@@ -71,7 +64,7 @@ public class UserController {
|
|
|
return success();
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/edit")
|
|
|
+ @PutMapping("/edit")
|
|
|
@SaCheckPermission("system:user:edit")
|
|
|
public CommonResult<String> edit(@RequestBody @Valid UserBO userBO) {
|
|
|
if (StrUtils.isBlank(userBO.getUserId())) {
|