Kaynağa Gözat

修改 gateway逻辑

guoenzhou 2 yıl önce
ebeveyn
işleme
49fb1fadc5

+ 1 - 1
base-components/gateway/src/main/java/com/ruoyi/gateway/filter/AuthFilter.java

@@ -24,7 +24,6 @@ import reactor.core.publisher.Mono;
 /**
  * 网关鉴权
  * 
- * @author ruoyi
  */
 @Component
 public class AuthFilter implements GlobalFilter, Ordered
@@ -82,6 +81,7 @@ public class AuthFilter implements GlobalFilter, Ordered
         addHeader(mutate, SecurityConstants.DETAILS_TENANT_ID, tenantId);
         // 内部请求来源参数清除
         removeHeader(mutate, SecurityConstants.FROM_SOURCE);
+        log.info();
         return chain.filter(exchange.mutate().request(mutate.build()).build());
     }
 

+ 1 - 0
base-components/gateway/src/main/java/com/ruoyi/gateway/handler/GatewayExceptionHandler.java

@@ -51,4 +51,5 @@ public class GatewayExceptionHandler implements ErrorWebExceptionHandler
 
         return ServletUtils.webFluxResponseWriter(response, msg);
     }
+
 }

+ 1 - 1
base-components/gateway/src/main/resources/bootstrap.yml

@@ -6,7 +6,7 @@ server:
 spring: 
   application:
     # 应用名称
-    name: gateway
+    name: ruoyi-gateway
   profiles:
     # 环境配置
     active: dev

+ 4 - 5
base-components/gateway/src/main/resources/logback.xml

@@ -3,7 +3,8 @@
     <!-- 日志存放路径 -->
 	<property name="log.path" value="/var/log/uskycloud/gateway" />
    <!-- 日志输出格式 -->
-	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
+<!--	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />-->
+    <property name="log.pattern" value="%d{MM-dd HH:mm:ss.SSS} %-5level [%X{requestId}] -- [%thread] %logger{26}:%line: %msg%n"/>
 
     <!-- 控制台输出 -->
 	<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
@@ -62,12 +63,10 @@
 	<!-- Spring日志级别控制  -->
 	<logger name="org.springframework" level="warn" />
 
-	<root level="info">
-		<appender-ref ref="console" />
-	</root>
-	
+
 	<!--系统操作日志-->
     <root level="info">
+        <appender-ref ref="CONSOLE"/>
         <appender-ref ref="file_info" />
         <appender-ref ref="file_error" />
     </root>

+ 0 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/MybatisGeneratorUtils.java → base-modules/service-system/service-system-biz/src/main/java/com/usky/system/MybatisGeneratorUtils.java


+ 0 - 16
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/TestController.java

@@ -1,16 +0,0 @@
-package com.usky.system.controller.web;
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author yq
- * @date 2022/6/23 13:12
- */
-@RestController
-@RequestMapping("/test")
-public class TestController {
-
-
-
-}

+ 2 - 2
base-modules/service-system/service-system-biz/src/main/resources/bootstrap.yml

@@ -14,10 +14,10 @@ spring:
     nacos:
       discovery:
         # 服务注册地址
-        server-addr: 172.16.120.165:8848
+        server-addr: usky-cloud-nacos:8848
       config:
         # 配置中心地址
-        server-addr: 172.16.120.165:8848
+        server-addr: usky-cloud-nacos:8848
         # 配置文件格式
         file-extension: yml
         # 共享配置