文件服务后台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1年前
1年前
1年前
1年前
1年前
1年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # file_transfer
  2. ## 项目信息结构
  3. | 名称 | 说明 | 例如 |
  4. |:-:|:-:|:-:|
  5. | name | 项目名 | 乳山 |
  6. | token | 项目唯一标识. 前端上传文件必须携带 | rushan |
  7. | remote_host | 远程项目地址. 前端或后端, 如果不能跨域则使用前端地址 | 如果使用后端地址: http://127.0.0.1:8080; 如果使用前端地址: http://127.0.0.1/api |
  8. | disk_path | 文件存储路径. application.yml中的nsgk.profile值, 路径分隔符必须使用正斜杠 | D:/NsgkSoft/files/nsgk/uploadPath |
  9. | disabled | 是否禁用. 1 或 0 | 1 则禁止上传 |
  10. ----------------------------------------------------------------------------------
  11. ## 通用接口
  12. * POST请求
  13. * 单文件字段是file
  14. > 仅上传
  15. >> `/open/file/upload/{项目唯一标识}/{存储目录}`
  16. > 上传并重定向
  17. >> `/open/file/uploadForward/{项目唯一标识}/{存储目录}`
  18. > * 必须参数: redirectUri 重定向地址, 必须是可以GET请求
  19. > * 其他参数: 将拼接到地址中
  20. > 上传并转发
  21. >> `/open/file/uploadForward/{项目唯一标识}/{存储目录}`
  22. > * 必须参数: requestUri 请求地址
  23. > * 必须参数: method 请求方法 默认get
  24. > * 必须参数: contentType 请求类型 get自动设为application/x-www-form-urlencoded, post默认application/json
  25. > * 必须参数: responseContentType 响应类型 默认application/json
  26. > * 其他参数: data 请求数据 String
  27. ----------------------------------------------------------------------------------
  28. ## 财务项目专用接口
  29. * POST请求
  30. * 单文件字段是file
  31. > 通用上传
  32. >> `/open/ruralCollectiveAssets/common/upload`
  33. > * 必须参数: token 项目唯一标识
  34. > * 必须参数: bizPath 存储目录, 默认upload
  35. > * 重定向到: `{remote_host}`/file/common/upload, 对应`{remote_host}`/common/upload
  36. > 附件上传
  37. >> `/open/ruralCollectiveAssets/common/attach`
  38. > * 必须参数: token 项目唯一标识
  39. > * 必须参数: bizPath 存储目录
  40. > * 必须参数: tableName 表名
  41. > * 必须参数: tableId 表ID
  42. > * 可选参数: fileType 额外类型
  43. > * 重定向到: `{remote_host}`/file/common/attach, 对应`{remote_host}`/common/attach
  44. > 客户服务器nginx配置代理
  45. ```
  46. location /file_server {
  47. proxy_set_header Host $http_host;
  48. proxy_set_header X-Real-IP $remote_addr;
  49. proxy_set_header REMOTE-HOST $remote_addr;
  50. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  51. rewrite ^/file_server/(.*)$ /$1 break;
  52. proxy_pass http://localhost:8077;
  53. }
  54. ```