Pre Merge pull request !66 from 胡庆春/master
commit
16a0c5f289
|
|
@ -17,6 +17,7 @@ import org.springframework.security.web.AuthenticationEntryPoint;
|
||||||
import org.springframework.security.web.SecurityFilterChain;
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
import org.springframework.security.web.access.AccessDeniedHandler;
|
import org.springframework.security.web.access.AccessDeniedHandler;
|
||||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.method.HandlerMethod;
|
import org.springframework.web.method.HandlerMethod;
|
||||||
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
||||||
|
|
@ -160,8 +161,16 @@ public class YudaoWebSecurityConfigurerAdapter {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Set<String> urls = entry.getKey().getPatternsCondition().getPatterns();
|
Set<String> urls = entry.getKey().getPatternsCondition().getPatterns();
|
||||||
|
//未指定请求方法则将4个Restful方法均添加到 result 结果
|
||||||
|
Set<RequestMethod> methods = entry.getKey().getMethodsCondition().getMethods();
|
||||||
|
if (methods.isEmpty()) {
|
||||||
|
result.putAll(HttpMethod.GET, urls);
|
||||||
|
result.putAll(HttpMethod.POST, urls);
|
||||||
|
result.putAll(HttpMethod.PUT, urls);
|
||||||
|
result.putAll(HttpMethod.DELETE, urls);
|
||||||
|
}
|
||||||
// 根据请求方法,添加到 result 结果
|
// 根据请求方法,添加到 result 结果
|
||||||
entry.getKey().getMethodsCondition().getMethods().forEach(requestMethod -> {
|
methods.forEach(requestMethod -> {
|
||||||
switch (requestMethod) {
|
switch (requestMethod) {
|
||||||
case GET:
|
case GET:
|
||||||
result.putAll(HttpMethod.GET, urls);
|
result.putAll(HttpMethod.GET, urls);
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,9 @@ public class AdminUserServiceImpl implements AdminUserService {
|
||||||
Set<Long> dbPostIds = convertSet(userPostMapper.selectListByUserId(userId), UserPostDO::getPostId);
|
Set<Long> dbPostIds = convertSet(userPostMapper.selectListByUserId(userId), UserPostDO::getPostId);
|
||||||
// 计算新增和删除的岗位编号
|
// 计算新增和删除的岗位编号
|
||||||
Set<Long> postIds = updateObj.getPostIds();
|
Set<Long> postIds = updateObj.getPostIds();
|
||||||
|
if (postIds==null) {
|
||||||
|
postIds = new LinkedHashSet<>();
|
||||||
|
}
|
||||||
Collection<Long> createPostIds = CollUtil.subtract(postIds, dbPostIds);
|
Collection<Long> createPostIds = CollUtil.subtract(postIds, dbPostIds);
|
||||||
Collection<Long> deletePostIds = CollUtil.subtract(dbPostIds, postIds);
|
Collection<Long> deletePostIds = CollUtil.subtract(dbPostIds, postIds);
|
||||||
// 执行新增和删除。对于已经授权的菜单,不用做任何处理
|
// 执行新增和删除。对于已经授权的菜单,不用做任何处理
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue