叶君翔 před 3 roky
rodič
revize
b6f4a2a543

+ 2 - 0
lb-third/lb-third-delivery/src/main/java/com/ydd/DeliveryApplication.java

@@ -5,6 +5,7 @@ import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 
 /**
  * 启动程序
@@ -12,6 +13,7 @@ import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfi
  * @author
  */
 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,DruidDataSourceAutoConfigure.class,SecurityAutoConfiguration.class })
+@EnableDiscoveryClient
 public class DeliveryApplication
 {
     public static void main(String[] args)

+ 14 - 33
lb-third/lb-third-delivery/src/main/resources/application.yml

@@ -1,20 +1,3 @@
-# 项目相关配置
-project:
-  # 名称
-  name: liebao
-  # 版本
-  version: 1.0
-  # 版权年份
-  copyrightYear: 2021
-  # 实例演示开关
-  demoEnabled: true
-  # 文件路径,使用jvm系统变量,兼容windows和linux
-  profile: ${user.dir}/upload/uploadPath
-  # 获取ip地址开关
-  addressEnabled: false
-  # 验证码类型 math 数组计算 char 字符验证
-  captchaType: math
-
 # 开发环境配置
 server:
   # 服务器的HTTP端口,默认为8080
@@ -52,21 +35,19 @@ logging:
 
 # Spring配置
 spring:
-  # 资源信息
-  messages:
-    # 国际化资源文件路径
-    basename: i18n/messages
   profiles:
     active: @profiles.active@
-  # 文件上传
-  servlet:
-    multipart:
-      # 单个文件大小
-      max-file-size: 50MB
-      # 设置总上传的文件大小
-      max-request-size: 100MB
-  # 服务模块
-  devtools:
-    restart:
-      # 热部署开关
-      enabled: true
+  application:
+    name: lb-delivery
+  cloud:
+    nacos:
+      discovery:
+        # 服务注册地址
+        server-addr: 153.37.175.42:8848
+      config:
+        # 配置中心地址
+        server-addr: 153.37.175.42:8848
+        file-extension: yml         # 配置文件格式
+        # 共享配置
+        shared-configs:
+          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}