StorageDict.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. 'encrypt_params' => ['secret_key'],
  49. 'component' => '/src/app/views/setting/components/storage-qiniu.vue',
  50. ],
  51. self::ALI => [
  52. 'name' => '阿里云存储',
  53. //配置参数
  54. 'params' => [
  55. 'bucket' => '存储空间',
  56. 'access_key' => 'ACCESS_KEY_ID',
  57. 'secret_key' => 'ACCESS_KEY_SECRET',
  58. 'endpoint' => 'Endpoint',
  59. 'domain' => '空间域名'
  60. ],
  61. 'encrypt_params' => ['secret_key'],
  62. 'component' => '/src/app/views/setting/components/storage-ali.vue',
  63. ],
  64. self::TENCENT => [
  65. 'name' => '腾讯云存储',
  66. //配置参数
  67. 'params' => [
  68. 'bucket' => '存储空间',
  69. 'region' => 'REGION',
  70. 'access_key' => 'SECRET_ID',
  71. 'secret_key' => 'SECRET_KEY',
  72. 'domain' => '空间域名'
  73. ],
  74. 'encrypt_params' => ['secret_key'],
  75. 'component' => '/src/app/views/setting/components/storage-tencent.vue',
  76. ],
  77. ];
  78. $extend = event('StorageType');
  79. return array_merge($system, ...$extend);
  80. }
  81. }