upload.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. 'excel' => [
  68. 'ext' => ['xls', 'xlsx'],
  69. 'mime' => [
  70. 'application/vnd.ms-excel',
  71. 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
  72. ],
  73. 'size' => 10485760
  74. ]
  75. ],
  76. 'thumb' => [
  77. 'thumb_type' => [
  78. 'big' => [
  79. 'width' => 1200,
  80. 'height' => 1200,
  81. ],
  82. 'mid' => [
  83. 'width' => 800,
  84. 'height' => 800,
  85. ],
  86. 'small' => [
  87. 'width' => 200,
  88. 'height' => 200,
  89. ],
  90. ]
  91. ]
  92. ];
  93. return (new DictLoader("Config"))->load(['data' => $system, 'name' => 'upload']);