StorageDict.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\dict\sys;
  12. /**
  13. * 云存储枚举类
  14. * Class StorageDict
  15. * @package app\dict\sys
  16. */
  17. class StorageDict
  18. {
  19. //本地存储
  20. public const LOCAL = 'local';
  21. //七牛云存储
  22. public const QINIU = 'qiniu';
  23. //阿里云存储
  24. public const ALI = 'aliyun';
  25. //腾讯云存储
  26. public const TENCENT = 'tencent';
  27. public const ON = '1';//开启
  28. public const OFF = '0';//关闭
  29. public static function getType()
  30. {
  31. $system = [
  32. self::LOCAL => [
  33. 'name' => '本地存储',
  34. //配置参数
  35. 'params' => [
  36. ],
  37. 'component' => '/src/app/views/setting/components/storage-local.vue',
  38. ],
  39. self::QINIU => [
  40. 'name' => '七牛云存储',
  41. //配置参数
  42. 'params' => [
  43. 'bucket' => '存储空间',
  44. 'access_key' => 'ACCESS_KEY',
  45. 'secret_key' => 'SECRET_KEY',
  46. 'domain' => '空间域名'
  47. ],
  48. 'component' => '/src/app/views/setting/components/storage-qiniu.vue',
  49. ],
  50. self::ALI => [
  51. 'name' => '阿里云存储',
  52. //配置参数
  53. 'params' => [
  54. 'bucket' => '存储空间',
  55. 'access_key' => 'ACCESS_KEY_ID',
  56. 'secret_key' => 'ACCESS_KEY_SECRET',
  57. 'endpoint' => 'Endpoint',
  58. 'domain' => '空间域名'
  59. ],
  60. 'component' => '/src/app/views/setting/components/storage-ali.vue',
  61. ],
  62. self::TENCENT => [
  63. 'name' => '腾讯云存储',
  64. //配置参数
  65. 'params' => [
  66. 'bucket' => '存储空间',
  67. 'region' => 'REGION',
  68. 'access_key' => 'SECRET_ID',
  69. 'secret_key' => 'SECRET_KEY',
  70. 'domain' => '空间域名'
  71. ],
  72. 'component' => '/src/app/views/setting/components/storage-tencent.vue',
  73. ],
  74. ];
  75. $extend = event('StorageType');
  76. return array_merge($system, ...$extend);
  77. }
  78. }