'home', 'basePath' => dirname(__DIR__), 'bootstrap' => [ 'log', 'clientMessage' ], 'vendorPath' => "@common/vendor", 'defaultRoute' => 'site/index',//默认控制器 'timeZone' => 'Asia/Shanghai', 'components' => [ 'request' => [ 'cookieValidationKey' => 'testas', 'enableCsrfValidation' => false //跨域提交问题 ], 'user' => [ 'identityClass' => '', 'enableAutoLogin' => false ], 'cache' => [ 'class' => 'yii\caching\FileCache' ], 'errorHandler' => [ 'errorAction' => 'error/index' ], /*'assetManager'=>[ 'bundles' => [ 'yii\bootstrap\BootstrapAsset' => [ 'css' => [] ], 'yii\web\JqueryAsset' => [ 'sourcePath' => null, 'js' => [] ], ] ],*/ 'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [ [ 'class' => 'yii\log\FileTarget', 'levels' => [ 'error', 'warning' ], 'exportInterval' => 0, 'logVars' => [], ] ], 'flushInterval' => 0, ], 'db' => require(__DIR__ . '/../../common/config/db.php'), 'mailer' => [ 'class' => 'yii\swiftmailer\Mailer', 'useFileTransport' => false,//这句一定有,false发送邮件,true只是生成邮件在runtime文件夹下,不发邮件 'transport' => [ 'class' => 'Swift_SmtpTransport', 'host' => 'smtp.126.com', //每种邮箱的host配置不一样 'username' => 'test@test.com', 'password' => 'pwd', 'port' => '25', //'encryption' => 'tls', ], 'messageConfig' => [ 'charset' => 'UTF-8', 'from' => ['test@test.com' => 'test'] ], ], 'urlManager' => [ 'enablePrettyUrl' => false, 'showScriptName' => false, 'rules' => [ ] ], 'redis' => [ 'class' => 'common\utils\MyRedisClient', ], 'clientMessage' => [ 'class' => ClientMessageServices::className(), ], 'easywechat' => [ 'class' => 'common\utils\EasyWeChatApplication', ], ], 'params' => require(__DIR__ . '/../../common/config/params.php'), 'as beforeRequest' => [ 'class' => 'yii\filters\Cors', ], // 'as beforeRequest' => [ // 'class' => 'common\services\ClientMessageFilter', // ] ]; if (YII_ENV_DEV) { // configuration adjustments for 'dev' environment /* $config['bootstrap'][] = 'debug'; $config['modules']['debug'] = [ 'class' => 'yii\debug\Module' ]; $config['bootstrap'][] = 'gii'; $config['modules']['gii'] = [ 'class' => 'yii\gii\Module' ];*/ } return $config;