main.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. return [
  3. 'aliases' => [
  4. '@bower' => '@vendor/bower-asset',
  5. '@npm' => '@vendor/npm-asset',
  6. ],
  7. 'vendorPath' => dirname(dirname(__DIR__)).'/vendor',
  8. 'language' => 'zh-CN',
  9. 'sourceLanguage' => 'zh-cn',
  10. 'timeZone' => 'Asia/Shanghai',
  11. 'bootstrap' => [
  12. 'queue', // 队列系统
  13. 'common\components\Init', // 加载默认的配置
  14. ],
  15. 'components' => [
  16. /** ------ 缓存 ------ **/
  17. 'cache' => [
  18. 'class' => 'yii\caching\FileCache',
  19. /**
  20. * 文件缓存一定要有,不然有可能会导致缓存数据获取失败的情况
  21. *
  22. * 注意如果要改成非文件缓存请删除,否则会报错
  23. */
  24. 'cachePath' => '@backend/runtime/cache'
  25. ],
  26. /** ------ redis配置 ------ **/
  27. 'redis' => [
  28. 'class' => 'yii\redis\Connection',
  29. 'hostname' => '127.0.0.1',
  30. 'port' => 6379,
  31. 'database' => 0,
  32. ],
  33. /** ------ 队列设置 ------ **/
  34. 'queue' => [
  35. 'class' => 'yii\queue\redis\Queue',
  36. 'redis' => 'redis', // 连接组件或它的配置
  37. 'channel' => 'queue', // Queue channel key
  38. 'as log' => 'yii\queue\LogBehavior',// 日志
  39. ],
  40. /** ------ 公用支付 ------ **/
  41. 'pay' => [
  42. 'class' => 'common\components\Pay',
  43. ],
  44. /** ------ 字节跳动小程序 ------ **/
  45. 'byteDance' => [
  46. 'class' => 'common\components\ByteDance',
  47. ],
  48. /** ------ 微信SDK ------ **/
  49. 'wechat' => [
  50. 'class' => 'common\components\Wechat',
  51. 'userOptions' => [], // 用户身份类参数
  52. 'sessionParam' => 'wechatUser', // 微信用户信息将存储在会话在这个密钥
  53. 'returnUrlParam' => '_wechatReturnUrl', // returnUrl 存储在会话中
  54. 'rebinds' => [
  55. 'cache' => 'common\components\WechatCache',
  56. ],
  57. ],
  58. /** ------ 二维码 ------ **/
  59. 'qr' => [
  60. 'class' => '\Da\QrCode\Component\QrCodeComponent',
  61. // ... 您可以在这里配置组件的更多属性
  62. ],
  63. /** ------ 格式化时间 ------ **/
  64. 'formatter' => [
  65. 'dateFormat' => 'yyyy-MM-dd',
  66. 'datetimeFormat' => 'yyyy-MM-dd HH:mm:ss',
  67. 'decimalSeparator' => ',',
  68. 'thousandSeparator' => ' ',
  69. 'currencyCode' => 'CNY',
  70. ],
  71. /** ------ 服务层 ------ **/
  72. 'services' => [
  73. 'class' => 'services\Application',
  74. ],
  75. ],
  76. ];
粤ICP备19079148号