From 78fa6f42b055f817af49c70b9798d206ff480552 Mon Sep 17 00:00:00 2001 From: weihongyang <1075331873@qq.com> Date: Tue, 9 Aug 2022 11:05:44 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=E4=BF=AE=E5=A4=8D=E5=BA=8F?= =?UTF-8?q?=E5=88=97=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cnbm/admin/config/SecurityConfig.java | 3 ++- .../java/com/cnbm/admin/entity/LoginUser.java | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ym-admin/src/main/java/com/cnbm/admin/config/SecurityConfig.java b/ym-admin/src/main/java/com/cnbm/admin/config/SecurityConfig.java index 2fff7b1..4c58b45 100644 --- a/ym-admin/src/main/java/com/cnbm/admin/config/SecurityConfig.java +++ b/ym-admin/src/main/java/com/cnbm/admin/config/SecurityConfig.java @@ -72,7 +72,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { "/swagger-ui/**", "/webjars/**", "/websocket/**", - "/captcha").anonymous() + "/captcha", + "druid/**").anonymous() // .antMatchers("/testCors").hasAuthority("system:dept:list222") // 除上面外的所有请求全部需要鉴权认证 .anyRequest() diff --git a/ym-admin/src/main/java/com/cnbm/admin/entity/LoginUser.java b/ym-admin/src/main/java/com/cnbm/admin/entity/LoginUser.java index 6729ecd..21569dd 100644 --- a/ym-admin/src/main/java/com/cnbm/admin/entity/LoginUser.java +++ b/ym-admin/src/main/java/com/cnbm/admin/entity/LoginUser.java @@ -1,16 +1,19 @@ package com.cnbm.admin.entity; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import lombok.Data; -import lombok.NoArgsConstructor; +import java.io.Serializable; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import lombok.Data; +import lombok.NoArgsConstructor; /** * @Author weihongyang @@ -20,7 +23,9 @@ import java.util.stream.Collectors; @Data @NoArgsConstructor @JsonIgnoreProperties(ignoreUnknown = true) -public class LoginUser implements UserDetails { +public class LoginUser implements UserDetails,Serializable { + + private static final long serialVersionUID = 1L; private SysUserEntity sysUserEntity;