Jelajahi Sumber

Merge remote-tracking branch 'origin/main'

yangliu 3 bulan lalu
induk
melakukan
4a18afac07

+ 7 - 7
src/main/java/cn/hfln/framework/gateway/config/StpInterfaceImpl.java

@@ -38,12 +38,12 @@ public class StpInterfaceImpl implements StpInterface {
 		long loginId = Long.parseLong(String.valueOf(loginIdObj));
 
 		List<String> roleList = this.getRoleList(loginId, loginType);
-		for (String roleId : roleList) {
+		for (String roleCode : roleList) {
 			String rolePermKeyPre = "hfln:perm:";
-			Set<String> permList = (Set<String>) redisService.get(rolePermKeyPre + roleId);
-			if (permList == null) {
-				log.error("角色权限列表不存在, roleId :{}", roleId);
-				throw new RuntimeException(roleId + "角色权限列表不存在");
+			Set<String> permList = (Set<String>) redisService.get(rolePermKeyPre + roleCode);
+			if (CollectionUtils.isEmpty(permList)) {
+				log.info("当前角色未配置权限, roleCode :{}", roleCode);
+				continue;
 			}
 			list.addAll(permList);
 		}
@@ -61,8 +61,8 @@ public class StpInterfaceImpl implements StpInterface {
 		String roleKeyPre = "hfln:role:";
 		Set<String> roleList = (Set<String>) redisService.get(roleKeyPre + loginId);
 		if (CollectionUtils.isEmpty(roleList)) {
-			log.error("角色配置异常, loginId :{}", loginId);
-			throw new RuntimeException("角色配置异常");
+			log.info("当前账户未配置角色, loginId :{}", loginId);
+			return new ArrayList<>();
 		}
 		return new ArrayList<>(roleList);
 	}

+ 5 - 1
src/main/resources/application.yml

@@ -2,7 +2,7 @@ server:
   port: 8090
 spring:
   profiles:
-    active: test
+    active: local
   application:
     name: hfln-interior-gateway
   cloud:
@@ -16,6 +16,8 @@ spring:
           uri: lb://portal-service-server
           predicates:
             - Path=/portal-service-server/**
+          filters:
+            - StripPrefix=1
 
 
 lnxx:
@@ -49,6 +51,8 @@ sa-token:
       - /api-docs/**
       - /api/doc.html
       - /knife4j/**
+      - /*/appspecific/**
+      - /favicon.ico/**
     loginUrls:
       - /portal-service-server/admin/manage/login
       - /portal-service-server/wap/user/wx/loginByPhone