Browse Source

文件上传

yangshun 3 weeks ago
parent
commit
39c783aeef

+ 2 - 1
guoyan-framework/guoyan-spring-boot-starter-security/src/main/java/com/cy/guoyan/admin/framework/security/config/GuoyanWebSecurityConfigurerAdapter.java

@@ -130,7 +130,8 @@ public class GuoyanWebSecurityConfigurerAdapter {
                 .authorizeHttpRequests(c -> c
                     // 1.1 静态资源,可匿名访问
                     .requestMatchers(HttpMethod.GET, "/*.html", "/*.css", "/*.js").permitAll()
-                    // 1.2 设置 @PermitAll 无需认证
+                        .requestMatchers(HttpMethod.GET, "/files/**").permitAll()
+                        // 1.2 设置 @PermitAll 无需认证
                     .requestMatchers(HttpMethod.GET, permitAllUrls.get(HttpMethod.GET).toArray(new String[0])).permitAll()
                     .requestMatchers(HttpMethod.POST, permitAllUrls.get(HttpMethod.POST).toArray(new String[0])).permitAll()
                     .requestMatchers(HttpMethod.PUT, permitAllUrls.get(HttpMethod.PUT).toArray(new String[0])).permitAll()

+ 10 - 31
guoyan-server/src/main/resources/application-local.yaml

@@ -58,39 +58,15 @@ spring:
       primary: master
       datasource:
         master:
-          url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
-          #          url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # MySQL Connector/J 5.X 连接的示例
-          #          url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
-          #          url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
-          #          url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true;useUnicode=true;characterEncoding=utf-8 # SQLServer 连接的示例
-          #          url: jdbc:dm://127.0.0.1:5236?schema=RUOYI_VUE_PRO # DM 连接的示例
-          #          url: jdbc:kingbase8://127.0.0.1:54321/test  # 人大金仓 KingbaseES 连接的示例
-          #          url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 连接的示例
+          #          url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
+          url: jdbc:mysql://47.117.156.104:3306/guoyan?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
           username: root
-          password: Hh112211
-          #          username: sa # SQL Server 连接的示例
-          #          password: Guoyan@2024 # SQL Server 连接的示例
-          #          username: SYSDBA # DM 连接的示例
-          #          password: SYSDBA001 # DM 连接的示例
-          #          username: root # OpenGauss 连接的示例
-          #          password: Guoyan@2024 # OpenGauss 连接的示例
-#        slave: # 模拟从库,可根据自己需要修改
-#          lazy: true # 开启懒加载,保证启动速度
-#          url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
-#          username: root
-#          password: Hh112211
-#        tdengine: # IoT 数据库(需要 IoT 物联网再开启噢!)
-#          url: jdbc:TAOS-RS://127.0.0.1:6041/ruoyi_vue_pro
-#          driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
-#          username: root
-#          password: taosdata
-#          druid:
-#            validation-query: SELECT SERVER_STATUS() # TDengine 数据源的有效性检查 SQL
+          password: gYzk45#$%ftddf
 
   # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
   redis:
     host: 127.0.0.1 # 地址
-    port: 6380 # 端口
+    port: 6379 # 端口
     database: 0 # 数据库索引
 #    password: dev # 密码,建议生产环境开启
 
@@ -282,6 +258,9 @@ pf4j:
   pluginsDir: ../plugins
 
 dify:
-  baseUrl : http://cerebrum.tsinghua-sh.cn
-  chatKey: app-KG4e98U3JC4ayYfjE7mgkZLg
-  datasetsKey: dataset-WrWlt2uOvkqZMLA7k4uJojrs
+  baseUrl : http://47.117.156.104:85
+  datasetsKey: dataset-hcKKHogDU7mJt1Z2y8LXCfmV
+
+ragflow:
+  endpoint: http://127.0.0.1:85
+  apiKey: ragflow-djYmI4Y2NjNWEyYzExZjA4ZTY2M2E4ZD

+ 6 - 32
guoyan-server/src/main/resources/application-prod.yaml

@@ -5,7 +5,7 @@ server:
 --- #################### 文件资源 ####################
 file:
   # 文件存储路径
-  upload-dir: /Users/shun/Documents/files/
+  upload-dir: /root/tools/files/
   # 文件访问路径
   access-path: /files/**
 
@@ -58,39 +58,14 @@ spring:
       primary: master
       datasource:
         master:
-          url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
-          #          url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # MySQL Connector/J 5.X 连接的示例
-          #          url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
-          #          url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
-          #          url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true;useUnicode=true;characterEncoding=utf-8 # SQLServer 连接的示例
-          #          url: jdbc:dm://127.0.0.1:5236?schema=RUOYI_VUE_PRO # DM 连接的示例
-          #          url: jdbc:kingbase8://127.0.0.1:54321/test  # 人大金仓 KingbaseES 连接的示例
-          #          url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 连接的示例
+          url: jdbc:mysql://127.0.0.1:3306/guoyan?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
           username: root
-          password: Hh112211
-          #          username: sa # SQL Server 连接的示例
-          #          password: Guoyan@2024 # SQL Server 连接的示例
-          #          username: SYSDBA # DM 连接的示例
-          #          password: SYSDBA001 # DM 连接的示例
-          #          username: root # OpenGauss 连接的示例
-          #          password: Guoyan@2024 # OpenGauss 连接的示例
-#        slave: # 模拟从库,可根据自己需要修改
-#          lazy: true # 开启懒加载,保证启动速度
-#          url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
-#          username: root
-#          password: Hh112211
-#        tdengine: # IoT 数据库(需要 IoT 物联网再开启噢!)
-#          url: jdbc:TAOS-RS://127.0.0.1:6041/ruoyi_vue_pro
-#          driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
-#          username: root
-#          password: taosdata
-#          druid:
-#            validation-query: SELECT SERVER_STATUS() # TDengine 数据源的有效性检查 SQL
+          password: gYzk45#$%ftddf
 
   # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
   redis:
     host: 127.0.0.1 # 地址
-    port: 6380 # 端口
+    port: 6379 # 端口
     database: 0 # 数据库索引
 #    password: dev # 密码,建议生产环境开启
 
@@ -282,6 +257,5 @@ pf4j:
   pluginsDir: ../plugins
 
 dify:
-  baseUrl : http://cerebrum.tsinghua-sh.cn
-  chatKey: app-KG4e98U3JC4ayYfjE7mgkZLg
-  datasetsKey: dataset-WrWlt2uOvkqZMLA7k4uJojrs
+  baseUrl : http://127.0.0.1:85
+  datasetsKey: dataset-hcKKHogDU7mJt1Z2y8LXCfmV

+ 2 - 2
guoyan-server/src/main/resources/application.yaml

@@ -12,8 +12,8 @@ spring:
   servlet:
     # 文件上传相关配置项
     multipart:
-      max-file-size: 16MB # 单个文件大小
-      max-request-size: 32MB # 设置总上传的文件大小
+      max-file-size: 1500MB # 单个文件大小
+      max-request-size: 3200MB # 设置总上传的文件大小
 
   # Jackson 配置项
   jackson: