mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-19 21:45:06 +08:00
完成用户列表的前后端对接
This commit is contained in:
@ -21,7 +21,7 @@ public class LoginUser implements UserDetails {
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private Long userId;
|
||||
private Long id;
|
||||
/**
|
||||
* 科室编号
|
||||
*/
|
||||
|
@ -6,7 +6,6 @@ import cn.iocoder.dashboard.framework.security.core.util.SecurityUtils;
|
||||
import cn.iocoder.dashboard.util.servlet.ServletUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.web.access.AccessDeniedHandler;
|
||||
import org.springframework.security.web.access.ExceptionTranslationFilter;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -36,7 +35,7 @@ public class AccessDeniedHandlerImpl implements AccessDeniedHandler {
|
||||
throws IOException, ServletException {
|
||||
// 打印 warn 的原因是,不定期合并 warn,看看有没恶意破坏
|
||||
log.warn("[commence][访问 URL({}) 时,用户({}) 权限不够]", request.getRequestURI(),
|
||||
SecurityUtils.getLoginUser().getUserId(), e);
|
||||
SecurityUtils.getLoginUser().getId(), e);
|
||||
// 返回 403
|
||||
ServletUtils.writeJSON(response, CommonResult.error(UNAUTHORIZED));
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public class SecurityUtils {
|
||||
* @return 用户编号
|
||||
*/
|
||||
public static Long getLoginUserId() {
|
||||
return getLoginUser().getUserId();
|
||||
return getLoginUser().getId();
|
||||
}
|
||||
|
||||
public static Set<Long> getLoginUserRoleIds() {
|
||||
|
Reference in New Issue
Block a user