| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- $params = require __DIR__ . '/params.php';
- $db = require __DIR__ . '/db.php';
- $redis = require __DIR__ . '/redis.php';
- $queue = require __DIR__ . '/queue.php';
- $config = [
- 'id' => 'cyy',
- 'language' => 'zh-CN',
- 'basePath' => dirname(__DIR__),
- 'bootstrap' => ['log', 'queue'],
- // 跨域全局配置
- 'as cors' => [
- 'class' => \yii\filters\Cors::class,
- 'cors' => [
- 'Origin' => ['*'],
- 'Access-Control-Request-Method' => ['GET', 'POST', 'OPTIONS'],
- 'Access-Control-Allow-Headers' => [
- 'X-Requested-With',
- 'Content-Type',
- 'Origin',
- 'Authorization',
- 'Accept',
- 'Access-Token',
- 'Accept-Encoding',
- ],
- 'Access-Control-Allow-Credentials' => false,
- ],
- ],
- 'components' => [
- 'request' => [
- 'enableCsrfCookie' => false,
- 'enableCookieValidation' => false,
- 'enableCsrfValidation' => false,
- ],
- 'session' => null,
- 'cache' => [
- 'class' => 'yii\caching\FileCache',
- 'fileMode' => 0777,
- ],
- 'cacheLock' => [
- 'class' => 'yii\caching\FileCache',
- 'fileMode' => 0777,
- 'cachePath' => '@runtime/cacheLock',
- ],
- 'jwt' => [
- 'class' => app\librarys\JwtComponent::class,
- 'key' => 'abc123456', // 密钥
- 'headerKey' => 'Authorization',
- ],
- 'storage' => [
- 'class' => app\librarys\storage\components\StorageComponent::class,
- 'basePath' => 'web/uploads'
- ],
- 'storageTemp' => [
- 'class' => app\librarys\storage\components\StorageComponent::class,
- 'basePath' => 'runtime/temp'
- ],
- 'errorHandler' => [
- 'errorAction' => 'common/default/error',
- ],
- 'mailer' => [
- 'class' => 'yii\swiftmailer\Mailer',
- // send all mails to a file by default. You have to set
- // 'useFileTransport' to false and configure a transport
- // for the mailer to send real emails.
- 'useFileTransport' => false,
- ],
- 'log' => [
- 'traceLevel' => YII_DEBUG ? 3 : 0,
- 'targets' => [
- [
- 'class' => 'yii\log\FileTarget',
- 'levels' => ['error', 'warning'],
- 'fileMode' => 0777,
- // 'maxLogFiles' => 300,
- // ],
- // [
- // 'class' => 'yii\log\FileTarget',
- // 'levels' => ['error', 'warning','info','trace','profile'],
- // 'logVars'=>[],
- // //表示以yii\db\或者app\models\开头的分类都会写入这个文件
- // 'categories'=>['yii\db\*'],
- // //表示写入到文件
- // 'logFile'=>'@runtime/../runtime/logs/YIISQL_'.date('y_m_d').'.log',
- // 'microtime' => true,
- ],
- ],
- ],
- 'db' => $db,
- 'redis' => $redis,
- 'queue' => $queue,
- 'urlManager' => [
- 'class' => 'app\librarys\common\UrlManager',
- 'enablePrettyUrl' => true,
- 'showScriptName' => false,
- 'rules' => [
- 'maiyatian/test/callback/<command:\w+>' => 'common/maiyatian/test',
- 'maiyatian/callback/<command:\w+>' => 'common/maiyatian/index',
- 'keloop/callback/index' => 'common/keloop/index',
- 'live/callback' => 'common/live/index',
- 'live/record' => 'common/live/record',
- 'mochat/callback/<store_id:\d+>' => 'common/mochat/index',
- 'mochat/api/<store_id:\d+>' => 'common/mochat/api',
- 'jushuitan/callback' => 'common/jushuitan/index',
- 'alipay/notify/<store_id:(\-)?\d+>' => 'common/alipay-notify/index',
- 'wechat/notify/<store_id:(\-)?\d+>' => 'common/wechat-notify/index',
- 'adapay/notify/<store_id:(\-)?\d+>' => 'common/adapay-notify/index',
- 'allinpay/notify/<store_id:(\-)?\d+>' => 'common/allinpay-notify/index',
- 'yunst/notify/<store_id:(\-)?\d+>' => 'common/yunst-notify/index',
- 'adapay/h5/<store_id:(\-)?\d+>' => 'common/adapay-notify/h5',
- 'alipay/callback' => 'common/alipay-callback/index',
- 'ad/callback/<store_id:\d+>' => 'common/ad-callback/index',
- 'alipay/spi' => 'common/alipay-callback/spi',
- 'bytedance/notify' => 'common/byte-dance-notify/index',
- 'wechat_mp/push' => 'common/wechat-mp/index',
- 'wechat/msg' => 'common/wechat-msg/index',
- 'wechat/api' => 'common/wechat-msg/api',
- 'wechat/ticket' => 'common/wechat-get-ticket/index',
- 'wechat/fuwu-buyer-login' => 'common/wechat-get-ticket/fuwu-buyer-login',
- 'wechat/callback/<appid>'=>'common/wechat-get-ticket/callback',
- 'alipay/notify'=> 'common/alipay-callback/ali-notice', // 消息通知
- 'alipay/token'=> 'common/alipay-callback/get-token', // 支付宝token
- //'alipay/notify'=> 'common/alipay-notify/index', // 网关验证
- 'douyin/ticket' => 'common/douyin/ticket',
- 'douyin/store-mini-code/<store_id>' => 'common/douyin/store-mini-code',
- 'douyin/callback/<appid>' => 'common/douyin/callback',
- 'wechat/video-shop-order/callback/<mini_id>' => 'common/wechat-callback/video-shop-order-callback',
- 'wechat/delivery-callback'=>'common/wechat-callback/delivery-call-back',
- 'wechat/transfer-batches-notify/<store_id:(\-)?\d+>' => 'common/wechat-callback/wechat-transfer-batches-notify',
- 'lg/cash-notify/<store_id:(\-)?\d+>' => 'common/lg-cash-notify/index',
- 'lg/apply-notify/<store_id:(\-)?\d+>' => 'common/lg-apply-notify/index',
- ],
- ]
- ],
- 'params' => $params,
- 'timeZone' => 'PRC',
- 'modules' => [
- 'common' => [
- 'class' => 'app\modules\common\Module',
- ],
- 'client' => [
- 'class' => 'app\modules\client\Module',
- ],
- 'admin' => [
- 'class' => 'app\modules\admin\Module',
- ],
- 'alliance' => [
- 'class' => 'app\modules\alliance\Module',
- ]
- ],
- 'defaultRoute' => 'common/default/index',
- 'aliases' => [
- '@ByteDance' => '@app/utils/ByteDance'
- ],
- ];
- return $config;
|