catch.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. return [
  3. /**
  4. * set domain if you need
  5. *
  6. */
  7. 'domain' => '',
  8. /**
  9. * 权限配置
  10. *
  11. */
  12. 'permissions' => [
  13. /**
  14. * get 请求不验证
  15. */
  16. 'is_allow_get' => true,
  17. /**
  18. * 超级管理员 ID
  19. *
  20. */
  21. 'super_admin_id' => 1,
  22. 'headmaster_id' => 3,
  23. /**
  24. * 方法认证标记
  25. *
  26. * 尽量使用唯以字符
  27. *
  28. */
  29. 'method_auth_mark' => '@CatchAuth'
  30. ],
  31. /**
  32. * auth 认证
  33. *
  34. */
  35. 'auth' => [
  36. // 默认
  37. 'default' => [
  38. 'guard' => 'admin',
  39. ],
  40. // 门面设置
  41. 'guards' => [
  42. // admin 认证
  43. 'admin' => [
  44. 'driver' => 'jwt',
  45. 'provider' => 'admin_users',
  46. ],
  47. // 开发者认证
  48. 'developer' => [
  49. 'driver' => 'jwt',
  50. 'provider' => 'developer',
  51. ],
  52. ],
  53. // 服务提供
  54. 'providers' => [
  55. // 后台用户认证服务
  56. 'admin_users' => [
  57. 'driver' => 'orm',
  58. 'model' => \catchAdmin\permissions\model\Users::class,
  59. ],
  60. // 开发这认证服务
  61. 'developer' => [
  62. 'driver'=> 'orm',
  63. 'model' => \catchAdmin\system\model\Developers::class
  64. ]
  65. ],
  66. ],
  67. /**
  68. * 自定义验证规则
  69. *
  70. */
  71. 'validates' => [
  72. \catcher\validates\Sometimes::class,
  73. \catcher\validates\SensitiveWord::class,
  74. ],
  75. /**
  76. * 上传设置
  77. *
  78. */
  79. 'upload' => [
  80. 'image' => 'fileSize:' . 1024 * 1024 * 5 . '|fileExt:jpg,png,gif,jpeg',
  81. 'file' => 'fileSize:' . 1024 * 1024 * 10 . '|fileExt:txt,pdf,xlsx,xls,html,mp4,mp3,amr,bin,mov',
  82. ],
  83. ];