|
@@ -7,12 +7,16 @@ 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.NotBlank;
|
|
|
import jakarta.validation.constraints.NotEmpty;
|
|
|
+import org.eco.vip.core.constant.Constants;
|
|
|
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.ConfigUtils;
|
|
|
import org.eco.vip.core.utils.ObjUtils;
|
|
|
import org.eco.vip.core.utils.StrUtils;
|
|
|
import org.eco.vip.nexus.core.domain.auth.pojo.LoginUserVO;
|
|
@@ -76,6 +80,19 @@ public class UserController {
|
|
|
}
|
|
|
return success();
|
|
|
}
|
|
|
+ @PutMapping("/password/reset")
|
|
|
+ @SaCheckPermission("system:user:edit")
|
|
|
+ public CommonResult<String> passwordReset(@RequestBody @Valid UserBO userBO) {
|
|
|
+ if (StrUtils.isBlank(userBO.getUserId())) {
|
|
|
+ return fail("用户id不能为空!");
|
|
|
+ }
|
|
|
+ userBO.setPassword(BCrypt.hashpw(ConfigUtils.getConfValue(Constants.INIT_PASSWORD)));
|
|
|
+ boolean result = userService.update(userBO);
|
|
|
+ if (!result) {
|
|
|
+ return fail("重置密码失败!");
|
|
|
+ }
|
|
|
+ return success();
|
|
|
+ }
|
|
|
|
|
|
@DeleteMapping("/delete")
|
|
|
@SaCheckPermission("system:user:delete")
|