类 UserController
java.lang.Object
net.sohelp.boot.admin.core.base.BaseController
net.sohelp.boot.demo.web.user.UserController
@RestController("admin-user")
@RequestMapping("/admin/user")
public class UserController
extends BaseController
用户详情控制器,提供用户信息查询、更新及密码修改等功能。
- 从以下版本开始:
- 2022/5/13
- 作者:
- AaronFung
-
字段概要
从类继承的字段 net.sohelp.boot.admin.core.base.BaseController
request, response -
构造器概要
构造器 -
方法概要
从类继承的方法 net.sohelp.boot.admin.core.base.BaseController
error, error, fail, fail, fail, getLoginID, getLoginName, getLoginOrgID, getLoginOrgName, getLoginUser, getNickname, getTenantId, getUserName, getUserNo, i18n, i18n, isAdministrator, isDeveloper, limit, offset, ok, ok, response, response, responseStream, success, success, success, success, validateToken
-
构造器详细资料
-
UserController
public UserController()
-
-
方法详细资料
-
detail
@GetMapping("/detail") @Permission("") @CrossOrigin(origins="*", maxAge=3600L) public ApiResult<Map<String,Object>> detail() throws Exception获取当前登录用户详细信息接口- 返回:
- 包含用户基本信息、角色权限、组织机构、主题配置等数据的结果对象
- 抛出:
Exception- 操作过程中可能发生的任意异常
-
update
@PostMapping("/update") @Permission("") public ApiResult<String> update(@RequestBody Map<String, Object> dataMap) throws TokenAuthenticationException, SQLException更新当前登录用户的基本信息- 参数:
dataMap- 请求体中的用户信息字段映射表- 返回:
- 成功提示结果
- 抛出:
TokenAuthenticationException- 认证失败时抛出异常SQLException- 数据库操作异常时抛出异常
-
changePassword
@PostMapping("/changePassword") @Transactional(rollbackFor=java.lang.Exception.class) @Permission("") public ApiResult<String> changePassword(@RequestBody Map<String, Object> paramMap) throws SQLException, TokenAuthenticationException修改当前登录用户的登录密码支持两种密码加密格式:
- SHA-256 加盐格式(96 位):使用 PasswordUtil 进行加密和校验
- MD5 格式(32 位):向后兼容旧版密码
- 参数:
paramMap- 请求体中包含旧密码、新密码和确认密码三个字段- 返回:
- 密码修改成功的提示消息
- 抛出:
SQLException- 数据库操作异常时抛出异常TokenAuthenticationException- 认证失败时抛出异常
-