Commit 9212d73f authored by 赵啸非's avatar 赵啸非

提交配置校验

parent ceb304d6
...@@ -96,7 +96,6 @@ ...@@ -96,7 +96,6 @@
<profiles.active>yanyuan</profiles.active> <profiles.active>yanyuan</profiles.active>
<profiles.nacos.server-addr>172.16.30.245:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>172.16.30.245:8848</profiles.nacos.server-addr>
<profiles.trustedReferer>127.0.0.1,localhost,10.233.82.175,172.16.30.245,172.16.30.246,172.16.30.247,172.16.30.248</profiles.trustedReferer> <profiles.trustedReferer>127.0.0.1,localhost,10.233.82.175,172.16.30.245,172.16.30.246,172.16.30.247,172.16.30.248</profiles.trustedReferer>
<profiles.req.json.check>true</profiles.req.json.check>
</properties> </properties>
</profile> </profile>
......
...@@ -19,8 +19,8 @@ import java.net.URL; ...@@ -19,8 +19,8 @@ import java.net.URL;
import java.util.*; import java.util.*;
@Slf4j @Slf4j
@Component //@Component
@Profile({"yanyuan"}) //@Profile({"yanyuan"})
public class SameSiteCookieFilter implements Filter { public class SameSiteCookieFilter implements Filter {
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
*/ */
package com.mortals.xhx.base.system.resource.model; package com.mortals.xhx.base.system.resource.model;
import java.util.List; import java.util.List;
/** /**
* <p>Title: 资源信息</p> * <p>Title: 资源信息</p>
......
...@@ -19,11 +19,11 @@ import com.mortals.xhx.base.system.resource.dao.ResourceDao; ...@@ -19,11 +19,11 @@ import com.mortals.xhx.base.system.resource.dao.ResourceDao;
import com.mortals.xhx.base.system.resource.model.ResourceEntity; import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import com.mortals.xhx.base.system.resource.model.ResourceQuery; import com.mortals.xhx.base.system.resource.model.ResourceQuery;
import com.mortals.xhx.base.system.resource.service.ResourceService; import com.mortals.xhx.base.system.resource.service.ResourceService;
import com.mortals.xhx.base.system.role.model.RoleAuthEntity;
import com.mortals.xhx.base.system.role.model.RoleAuthQuery;
import com.mortals.xhx.base.system.role.service.RoleAuthService;
import com.mortals.xhx.common.key.RedisKey; import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.utils.ControllerScanUtil; import com.mortals.xhx.common.utils.ControllerScanUtil;
import com.mortals.xhx.module.role.model.RoleAuthEntity;
import com.mortals.xhx.module.role.model.RoleAuthQuery;
import com.mortals.xhx.module.role.service.RoleAuthService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -73,14 +73,7 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re ...@@ -73,14 +73,7 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re
@Override @Override
public Set<String> findUrlSetByUserId(Long userId) throws AppException { public Set<String> findUrlSetByUserId(Long userId) throws AppException {
Set<String> urls = new HashSet<>(); Set<String> urls = new HashSet<>();
List<ResourceEntity> resList = new ArrayList<>(); List<ResourceEntity> resList = this.findListByUserId(userId);
if (1L == userId) {
//管理员
resList = this.find(new ResourceQuery());
} else {
resList = this.findListByUserId(userId);
}
for (ResourceEntity res : resList) { for (ResourceEntity res : resList) {
String url = res.getUrl(); String url = res.getUrl();
if (StringUtils.isEmpty(url)) { if (StringUtils.isEmpty(url)) {
...@@ -101,7 +94,7 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re ...@@ -101,7 +94,7 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re
public Rest<String> refreshResourceUrl(String packageName, Context context) { public Rest<String> refreshResourceUrl(String packageName, Context context) {
List<Class<?>> classList = ControllerScanUtil.getAllClassByPackageName(packageName); List<Class<?>> classList = ControllerScanUtil.getAllClassByPackageName(packageName);
//System.out.println(classList); //获取到了所有的类 //System.out.println(classList); //获取到了所有的类
List<ResourceEntity> newResourcelist = ControllerScanUtil.getAnnotationInfo(classList).stream().filter(f -> !ObjectUtils.isEmpty(f.getUrl())).collect(Collectors.toList()); List<ResourceEntity> newResourcelist = ControllerScanUtil.getAnnotationInfo(classList).stream().filter(f->!ObjectUtils.isEmpty(f.getUrl())).collect(Collectors.toList());
Map<String, List<ResourceEntity>> localResourceMap = this.find(new ResourceQuery()).stream().collect(Collectors.groupingBy(x -> x.getName())); Map<String, List<ResourceEntity>> localResourceMap = this.find(new ResourceQuery()).stream().collect(Collectors.groupingBy(x -> x.getName()));
Map<String, List<ResourceEntity>> newResourceMap = newResourcelist.stream().collect(Collectors.groupingBy(x -> x.getName())); Map<String, List<ResourceEntity>> newResourceMap = newResourcelist.stream().collect(Collectors.groupingBy(x -> x.getName()));
...@@ -191,14 +184,12 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re ...@@ -191,14 +184,12 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re
} }
private void updateUserMenuUrlCache() { private void updateUserMenuUrlCache() {
//更新用户菜单
cacheService.del(RedisKey.KEY_USER_MENU_CACHE);
/* //更新用户菜单
Set<String> hkeys = cacheService.hkeys(RedisKey.KEY_USER_MENU_CACHE); Set<String> hkeys = cacheService.hkeys(RedisKey.KEY_USER_MENU_CACHE);
for (String userId : hkeys) { for (String userId : hkeys) {
Set<String> urls = this.findUrlSetByUserId(DataUtil.converStr2Long(userId, 0L)); Set<String> urls = this.findUrlSetByUserId(DataUtil.converStr2Long(userId, 0L));
String menuUrlCode = generateMenuUrlCode(urls); String menuUrlCode = generateMenuUrlCode(urls);
cacheService.hset(RedisKey.KEY_USER_MENU_CACHE, userId, menuUrlCode); cacheService.hset(RedisKey.KEY_USER_MENU_CACHE, userId, menuUrlCode);
}*/ }
} }
} }
\ No newline at end of file
...@@ -8,6 +8,7 @@ import com.mortals.framework.common.Rest; ...@@ -8,6 +8,7 @@ import com.mortals.framework.common.Rest;
import com.mortals.framework.common.code.UserType; import com.mortals.framework.common.code.UserType;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.resource.model.ResourceEntity; import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import com.mortals.xhx.base.system.resource.service.ResourceService; import com.mortals.xhx.base.system.resource.service.ResourceService;
...@@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -67,7 +69,7 @@ public class ResourceController extends BaseCRUDJsonBodyMappingController<Resour ...@@ -67,7 +69,7 @@ public class ResourceController extends BaseCRUDJsonBodyMappingController<Resour
@Override @Override
protected void doListBefore(ResourceEntity query, Map<String, Object> model, Context context) throws AppException { protected void doListBefore(ResourceEntity query, Map<String, Object> model, Context context) throws AppException {
query.setOrderColList(Arrays.asList(new OrderCol("sourceType")));
super.doListBefore(query, model, context); super.doListBefore(query, model, context);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment