x-file-storage
x-file-storage copied to clipboard
使用ruoyi springboot时 本地存储引擎的静态资源无法访问
springboot 版本: 2.5.15 x file storage版本: 2.1.0
配置文件
dromara:
x-file-storage: #文件存储配置
default-platform: local #默认使用的存储平台
thumbnail-suffix: ".min.jpg" #缩略图后缀,例如【.min.jpg】【.png】
#平台的配置
local-plus:
- platform: local # 存储平台标识
enable-storage: true #启用存储
enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高)
domain: http://127.0.0.1:9090/file/ # 访问域名,后面要和 path-patterns 保持一致,“/”结尾
base-path: storage/ # 基础路径
path-patterns: /file/** # 访问路径
storage-path: D:/ranking/ # 存储路径
问题:上传流程正常 文件数据也能保存到数据库 但是访问url 提示404
访问url:http://127.0.0.1:9090/file/storage/6642f6314907bf5b662aad93.png
尝试:自动配置加载正常
请问这种情况是配置有误 或者是环境中有和xfile冲突的配置?
谢谢您的回复
目前版本是有这个问题,参考:https://github.com/dromara/x-file-storage/issues/229
了解了 手动写一个文件映射的WebConfig注入就正常了
2.2.0版本已修复此问题,详情查看 更新记录