upload.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. use core\dict\DictLoader;
  3. $system = [
  4. 'default' => 'local',//默认驱动
  5. 'drivers' => [
  6. //本地上传
  7. 'local' => [],
  8. //七牛云
  9. 'qiniu' => [
  10. 'access_key' => '',
  11. 'secret_key' => '',
  12. 'bucket' => ''
  13. ],
  14. //阿里云
  15. 'aliyun' => [
  16. 'access_key' => '',
  17. 'secret_key' => '',
  18. 'endpoint' => '',
  19. 'bucket' => ''
  20. ],
  21. //腾讯云
  22. 'tencent' => [
  23. 'access_key' => '',
  24. 'secret_key' => '',
  25. 'region' => '',
  26. 'bucket' => ''
  27. ],
  28. ],
  29. // 默认规则
  30. 'rules' => [
  31. 'image' => [
  32. 'ext' => ['jpg', 'jpeg', 'png', 'gif'],
  33. 'mime' => ['image/jpeg', 'image/gif', 'image/png'],
  34. 'size' => 10485760
  35. ],
  36. 'video' => [
  37. 'ext' => ['mp4'],
  38. 'mime' => ['video/mp4'],
  39. 'size' => 104857600
  40. ],
  41. 'wechat' => [
  42. 'ext' => ['pem', 'key'],
  43. 'mime' => [
  44. 'application/x-x509-ca-cert',
  45. 'application/octet-stream',
  46. 'application/x-iwork-keynote-sffkey'
  47. ],
  48. 'size' => 2097152
  49. ],
  50. 'aliyun' => [
  51. 'ext' => ['crt'],
  52. 'mime' => [
  53. 'application/x-x509-ca-cert',
  54. 'application/octet-stream'
  55. ],
  56. 'size' => 2097152
  57. ],
  58. 'applet' => [
  59. 'ext' => ['zip', 'rar'],
  60. 'mime' => [
  61. 'application/zip',
  62. 'application/vnd.rar',
  63. 'application/x-zip-compressed'
  64. ],
  65. 'size' => 2097152
  66. ]
  67. ],
  68. 'thumb' => [
  69. 'thumb_type' => [
  70. 'big' => [
  71. 'width' => 800,
  72. 'height' => 800,
  73. ],
  74. 'mid' => [
  75. 'width' => 400,
  76. 'height' => 400,
  77. ],
  78. 'small' => [
  79. 'width' => 200,
  80. 'height' => 200,
  81. ],
  82. ]
  83. ]
  84. ];
  85. return (new DictLoader("Config"))->load(['data' => $system, 'name' => 'upload']);