소스 검색

变更配置方式改为nacos

chengpan 2 년 전
부모
커밋
5ee0c45905

+ 19 - 2
pom.xml

@@ -42,11 +42,28 @@
             <dependency>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-dependencies</artifactId>
-                <version>2.5.14</version>
+                <version>2.3.12.RELEASE</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
-            
+            <!-- SpringCloud 微服务 -->
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-dependencies</artifactId>
+                <version>Hoxton.SR12</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+
+            <!-- SpringCloud Alibaba 微服务 -->
+            <dependency>
+                <groupId>com.alibaba.cloud</groupId>
+                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
+                <version>2.2.6.RELEASE</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+
             <!-- 阿里数据库连接池 -->
             <dependency>
                 <groupId>com.alibaba</groupId>

+ 10 - 1
ruoyi-admin/pom.xml

@@ -70,7 +70,16 @@
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
         </dependency>
-
+        <!-- SpringCloud Alibaba Nacos -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+        </dependency>
+        <!-- SpringCloud Alibaba Config -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

+ 0 - 0
ruoyi-admin/src/main/resources/application-test.yml → ruoyi-admin/src/main/resources/application-test-bak.yml


+ 9 - 31
ruoyi-admin/src/main/resources/application.yml

@@ -1,27 +1,3 @@
-appId: ZLTX370100
-sign: 4Ja5AFIAqnMC72G5Lvp4vcUwbnGKTp8g/htlGontuhQ=
-# 测试地址
-testHttps: https://www2.laikuaidian.cn
-#生产地址
-prodHttps: https://hezuo.cyc-fund.com.cn
-#法大大url
-zFddUrl: http://192.168.1.127:8182/fdd/extsign.do?processId=
-#泽斌本地
-zUrl: http://192.168.1.127:8182/
-# 请求订单信息的url
-processUrl: /guaranteeJSONCtrl/JSONQuerybidder.do
-# www审核通知接口url
-checkUrl: /guaranteeJSONCtrl/JSONNotifications.do
-# www支付回调接口通知
-payUrl: /guaranteeJSONCtrl/JSONPayInfoInterface.do
-# www承保回调接口通知
-coverUrl: /guaranteeJSONCtrl/JSONCBInfoInterface.do
-#填充接口url
-templateUrl: https://www2.laikuaidian.cn/fdd/extsign.do?processId=
-
-#电子发票接口
-invoiceUrl: /guaranteeJSONCtrl/JSONFPInfoInterface.do
-
 # Spring配置
 spring:
   # 模板引擎
@@ -37,8 +13,8 @@ spring:
   jackson:
     time-zone: GMT+8
     date-format: yyyy-MM-dd HH:mm:ss
-  profiles: 
-    active: dev
+  profiles:
+    active: test
   # 文件上传
   servlet:
      multipart:
@@ -75,7 +51,7 @@ mybatis-plus:
       cache-enabled: false
       log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 # PageHelper分页插件
-pagehelper: 
+pagehelper:
   helperDialect: mysql
   supportMethodsArguments: true
   params: count=countSql
@@ -107,7 +83,7 @@ shiro:
     captchaType: math
   cookie:
     # 设置Cookie的域名 默认空,即当前访问的域名
-    domain: 
+    domain:
     # 设置cookie的有效访问路径
     path: /
     # 设置HttpOnly属性
@@ -115,7 +91,7 @@ shiro:
     # 设置Cookie的过期时间,天为单位
     maxAge: 30
     # 设置密钥,务必保持唯一性(生成方式,直接拷贝到main运行即可)Base64.encodeToString(CipherUtils.generateNewKey(128, "AES").getEncoded()) (默认启动生成随机秘钥,随机秘钥会导致之前客户端RememberMe Cookie无效,如设置固定秘钥RememberMe Cookie则有效)
-    cipherKey: 
+    cipherKey:
   session:
     # Session超时时间,-1代表永不过期(默认30分钟)
     expireTime: 30
@@ -132,10 +108,12 @@ shiro:
     enabled: true
 
 # 防止XSS攻击
-xss: 
+xss:
   # 过滤开关
   enabled: true
   # 排除链接(多个用逗号分隔)
   excludes: /system/notice/*
   # 匹配链接
-  urlPatterns: /system/*,/monitor/*,/tool/*
+  urlPatterns: /system/*,/monitor/*,/tool/*
+server:
+  port: 8080

+ 13 - 0
ruoyi-admin/src/main/resources/bootstrap.yml

@@ -0,0 +1,13 @@
+spring:
+  application:
+    name: own-letter
+  cloud:
+    nacos:
+      discovery:
+        server-addr: 192.168.1.228:8848 # nacos服务注册中心地址
+        namespace: 275a3e6b-aa4d-4771-8935-540285cbfe1f
+      config:
+        server-addr: 192.168.1.228:8848 # nacos配置中心地址
+        file-extension: yml # 指定yamlg格式的配置
+        group: TEST_GROUP
+        namespace: 275a3e6b-aa4d-4771-8935-540285cbfe1f