完成用户列表的前后端对接

This commit is contained in:
YunaiV
2021-01-10 12:19:39 +08:00
parent cdaa0d9195
commit f5b7142ab6
18 changed files with 480 additions and 319 deletions

View File

@ -21,7 +21,7 @@ public class LoginUser implements UserDetails {
/**
* 用户编号
*/
private Long userId;
private Long id;
/**
* 科室编号
*/

View File

@ -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));
}

View File

@ -50,7 +50,7 @@ public class SecurityUtils {
* @return 用户编号
*/
public static Long getLoginUserId() {
return getLoginUser().getUserId();
return getLoginUser().getId();
}
public static Set<Long> getLoginUserRoleIds() {