web.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. $params = require __DIR__ . '/params.php';
  8. $db = require __DIR__ . '/db.php';
  9. $redis = require __DIR__ . '/redis.php';
  10. $queue = require __DIR__ . '/queue.php';
  11. $config = [
  12. 'id' => 'cyy',
  13. 'language' => 'zh-CN',
  14. 'basePath' => dirname(__DIR__),
  15. 'bootstrap' => ['log', 'queue'],
  16. // 跨域全局配置
  17. 'as cors' => [
  18. 'class' => \yii\filters\Cors::class,
  19. 'cors' => [
  20. 'Origin' => ['*'],
  21. 'Access-Control-Request-Method' => ['GET', 'POST', 'OPTIONS'],
  22. 'Access-Control-Allow-Headers' => [
  23. 'X-Requested-With',
  24. 'Content-Type',
  25. 'Origin',
  26. 'Authorization',
  27. 'Accept',
  28. 'Access-Token',
  29. 'Accept-Encoding',
  30. ],
  31. 'Access-Control-Allow-Credentials' => false,
  32. ],
  33. ],
  34. 'components' => [
  35. 'request' => [
  36. 'enableCsrfCookie' => false,
  37. 'enableCookieValidation' => false,
  38. 'enableCsrfValidation' => false,
  39. ],
  40. 'session' => null,
  41. 'cache' => [
  42. 'class' => 'yii\caching\FileCache',
  43. 'fileMode' => 0777,
  44. ],
  45. 'cacheLock' => [
  46. 'class' => 'yii\caching\FileCache',
  47. 'fileMode' => 0777,
  48. 'cachePath' => '@runtime/cacheLock',
  49. ],
  50. 'jwt' => [
  51. 'class' => app\librarys\JwtComponent::class,
  52. 'key' => 'abc123456', // 密钥
  53. 'headerKey' => 'Authorization',
  54. ],
  55. 'storage' => [
  56. 'class' => app\librarys\storage\components\StorageComponent::class,
  57. 'basePath' => 'web/uploads'
  58. ],
  59. 'storageTemp' => [
  60. 'class' => app\librarys\storage\components\StorageComponent::class,
  61. 'basePath' => 'runtime/temp'
  62. ],
  63. 'errorHandler' => [
  64. 'errorAction' => 'common/default/error',
  65. ],
  66. 'mailer' => [
  67. 'class' => 'yii\swiftmailer\Mailer',
  68. // send all mails to a file by default. You have to set
  69. // 'useFileTransport' to false and configure a transport
  70. // for the mailer to send real emails.
  71. 'useFileTransport' => false,
  72. ],
  73. 'log' => [
  74. 'traceLevel' => YII_DEBUG ? 3 : 0,
  75. 'targets' => [
  76. [
  77. 'class' => 'yii\log\FileTarget',
  78. 'levels' => ['error', 'warning'],
  79. 'fileMode' => 0777,
  80. // 'maxLogFiles' => 300,
  81. // ],
  82. // [
  83. // 'class' => 'yii\log\FileTarget',
  84. // 'levels' => ['error', 'warning','info','trace','profile'],
  85. // 'logVars'=>[],
  86. // //表示以yii\db\或者app\models\开头的分类都会写入这个文件
  87. // 'categories'=>['yii\db\*'],
  88. // //表示写入到文件
  89. // 'logFile'=>'@runtime/../runtime/logs/YIISQL_'.date('y_m_d').'.log',
  90. // 'microtime' => true,
  91. ],
  92. ],
  93. ],
  94. 'db' => $db,
  95. 'redis' => $redis,
  96. 'queue' => $queue,
  97. 'urlManager' => [
  98. 'class' => 'app\librarys\common\UrlManager',
  99. 'enablePrettyUrl' => true,
  100. 'showScriptName' => false,
  101. 'rules' => [
  102. 'maiyatian/test/callback/<command:\w+>' => 'common/maiyatian/test',
  103. 'maiyatian/callback/<command:\w+>' => 'common/maiyatian/index',
  104. 'keloop/callback/index' => 'common/keloop/index',
  105. 'live/callback' => 'common/live/index',
  106. 'live/record' => 'common/live/record',
  107. 'mochat/callback/<store_id:\d+>' => 'common/mochat/index',
  108. 'mochat/api/<store_id:\d+>' => 'common/mochat/api',
  109. 'jushuitan/callback' => 'common/jushuitan/index',
  110. 'alipay/notify/<store_id:(\-)?\d+>' => 'common/alipay-notify/index',
  111. 'wechat/notify/<store_id:(\-)?\d+>' => 'common/wechat-notify/index',
  112. 'adapay/notify/<store_id:(\-)?\d+>' => 'common/adapay-notify/index',
  113. 'allinpay/notify/<store_id:(\-)?\d+>' => 'common/allinpay-notify/index',
  114. 'yunst/notify/<store_id:(\-)?\d+>' => 'common/yunst-notify/index',
  115. 'adapay/h5/<store_id:(\-)?\d+>' => 'common/adapay-notify/h5',
  116. 'alipay/callback' => 'common/alipay-callback/index',
  117. 'ad/callback/<store_id:\d+>' => 'common/ad-callback/index',
  118. 'alipay/spi' => 'common/alipay-callback/spi',
  119. 'bytedance/notify' => 'common/byte-dance-notify/index',
  120. 'wechat_mp/push' => 'common/wechat-mp/index',
  121. 'wechat/msg' => 'common/wechat-msg/index',
  122. 'wechat/api' => 'common/wechat-msg/api',
  123. 'wechat/ticket' => 'common/wechat-get-ticket/index',
  124. 'wechat/fuwu-buyer-login' => 'common/wechat-get-ticket/fuwu-buyer-login',
  125. 'wechat/callback/<appid>'=>'common/wechat-get-ticket/callback',
  126. 'alipay/notify'=> 'common/alipay-callback/ali-notice', // 消息通知
  127. 'alipay/token'=> 'common/alipay-callback/get-token', // 支付宝token
  128. //'alipay/notify'=> 'common/alipay-notify/index', // 网关验证
  129. 'douyin/ticket' => 'common/douyin/ticket',
  130. 'douyin/store-mini-code/<store_id>' => 'common/douyin/store-mini-code',
  131. 'douyin/callback/<appid>' => 'common/douyin/callback',
  132. 'wechat/video-shop-order/callback/<mini_id>' => 'common/wechat-callback/video-shop-order-callback',
  133. 'wechat/delivery-callback'=>'common/wechat-callback/delivery-call-back',
  134. 'wechat/transfer-batches-notify/<store_id:(\-)?\d+>' => 'common/wechat-callback/wechat-transfer-batches-notify',
  135. 'lg/cash-notify/<store_id:(\-)?\d+>' => 'common/lg-cash-notify/index',
  136. 'lg/apply-notify/<store_id:(\-)?\d+>' => 'common/lg-apply-notify/index',
  137. ],
  138. ]
  139. ],
  140. 'params' => $params,
  141. 'timeZone' => 'PRC',
  142. 'modules' => [
  143. 'common' => [
  144. 'class' => 'app\modules\common\Module',
  145. ],
  146. 'client' => [
  147. 'class' => 'app\modules\client\Module',
  148. ],
  149. 'admin' => [
  150. 'class' => 'app\modules\admin\Module',
  151. ],
  152. 'alliance' => [
  153. 'class' => 'app\modules\alliance\Module',
  154. ]
  155. ],
  156. 'defaultRoute' => 'common/default/index',
  157. 'aliases' => [
  158. '@ByteDance' => '@app/utils/ByteDance'
  159. ],
  160. ];
  161. return $config;