123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <?php
- $params = array_merge(
- require __DIR__ . '/../../common/config/params.php',
- require __DIR__ . '/../../common/config/params-local.php',
- require __DIR__ . '/params.php',
- require __DIR__ . '/params-local.php'
- );
- $emailConfig = json_decode(file_get_contents(Yii::getAlias('@backend').'/config/email.json'),true);
- return [
- 'id' => 'app-frontend',
- 'basePath' => dirname(__DIR__),
- 'bootstrap' => ['log'],
- 'controllerNamespace' => 'frontend\controllers',
- 'components' => [
- 'request' => [
- 'csrfParam' => 'csrf_token_f',
- ],
- 'user' => [
- 'identityClass' => 'common\models\User',
- 'enableAutoLogin' => true,
- 'identityCookie' => ['name' => '_identity-frontend', 'httpOnly' => true],
- ],
- 'hostserver' => [
- 'class' => 'common\api\HostServer',
- ],
- 'session' => [
- // this is the name of the session cookie used for login on the frontend
- 'name' => 'advanced-frontend',
- ],
- 'mailer' => [ //邮箱设置
- 'class' => 'yii\swiftmailer\Mailer',
- 'useFileTransport' => false,//这句一定有,false发送邮件,true只是生成邮件在runtime文件夹下,不发邮件
- 'transport' => $emailConfig,
- 'messageConfig'=>[
- 'charset'=>'UTF-8',
- 'from'=>[$emailConfig['username']=>'客户报名信息']
- ],
- ],
- 'log' => [
- 'traceLevel' => YII_DEBUG ? 3 : 0,
- 'targets' => [
- [
- 'class' => 'yii\log\FileTarget',
- 'levels' => ['error', 'warning'],
- ],
- // [
- // 'class' => 'yii\log\FileTarget',
- // 'levels' => ['error'],
- // 'logVars'=>[],
- // //表示以yii\db\或者app\models\开头的分类都会写入这个文件
- // 'categories'=>['yii\db\*','common\models\*'],
- // //表示写入到文件sql.log中年月日记录日志
- // 'logFile'=>'@runtime/../logs/sql/sql.log'.date('Ymd'),
- // ],
- // [
- // 'class' => 'yii\log\EmailTarget',
- // 'mailer' => 'mailer',
- // 'levels' => ['error', 'warning'],
- //// 'categories' => ['yii\db\*','common\models\*','backend\controllers\*'],
- // 'message' => [
- // 'from'=>[$emailConfig['username']=>'易购'],
- // 'to' => ['313298389@qq.com'],
- // 'subject' => '易购-错误信息',
- // ],
- // ],
- ],
- ],
- 'errorHandler' => [
- 'errorAction' => 'public/error',
- ],
- 'assetManager' => [
- // 'class' => 'yii\web\AssetManager',
- // 'appendTimestamp' => true,
- // 'forceCopy' => true,
- 'bundles' => [
- // 'linkAssets' => true,
- 'yii\web\YiiAsset' => [
- 'js' => [], // 去除 yii.js
- 'sourcePath' => null, // 防止在 frontend/web/asset 下生产文件
- ],
- 'yii\widgets\ActiveFormAsset' => [
- 'js' => [], // 去除 yii.activeForm.js
- 'sourcePath' => null, // 防止在 frontend/web/asset 下生产文件
- ],
- 'yii\validators\ValidationAsset' => [
- 'js' => [], // 去除 yii.validation.js
- 'sourcePath' => null, // 防止在 frontend/web/asset 下生产文件
- ],
- // 'yii\bootstrap\BootstrapAsset' => [
- // 'css' => [], // 去除 bootstrap.css
- // 'sourcePath' => null, // 防止在 frontend/web/asset 下生产文件
- // ],
- 'yii\bootstrap\BootstrapPluginAsset' => [
- 'js' => [], // 去除 bootstrap.js
- 'sourcePath' => null, // 防止在 frontend/web/asset 下生产文件
- ],
- 'yii\web\JqueryAsset' => [
- 'js' => [], // 去除 jquery.js
- 'sourcePath' => null, // 防止在 frontend/web/asset 下生产文件
- ],
- ],
- ],
- 'urlManager' => [
- 'enablePrettyUrl' => true,
- 'showScriptName' => false,
- // 'enableStrictParsing' => true,
- 'rules' => [
-
- '/house/search<t:(/|)>' =>'/house/search',
- '/house/vr<t:(/|)>' =>'/house/vr',
- '/house/search<t:(/|)>' =>'/house/search',
- '/house/abroad<t:(/|)>' =>'/house/abroad',
- '/'=>'index/index',
- '/json/cityprice'=>'/json/cityprice',
- '/json/houseprice'=>'/json/houseprice',
- '/house/remark/<hid:\w+><t:(/|)>' =>'/house/remark',//楼盘点评
- '/house/news/<hid:\w+><t:(/|)>' =>'/house/news',
- '/house/typedetails/<hid:\w+><t:(/|)>' => '/house/typedetails', //楼盘户型详情页
- '/house/type/<hid:\w+><t:(/|)>' =>'/house/type',
- '/house/details/<hid:\w+><t:(/|)>' =>'/house/details',
- '/house/periphery/<hid:\w+><t:(/|)>' =>'/house/periphery',
- '/house/album/<hid:\w+><t:(/|)>' =>'/house/album',
- '/house/remarkfrom' => "house/remarkfrom",
- '/house/houseremark/<hid:\w+><t:(/|)>' => "/house/houseremark",
- '/house/remarklikesfrom' => '/house/remarklikesfrom',
- '/house/dynamic' =>'/house/dynamic',
- '/house/housetype' =>'/house/housetype',
- '/house/housetypeall' =>'/house/housetypeall',
- '/house/albumlist' =>'/house/albumlist',
- '/house/getalbumlist' =>'/house/getalbumlist',
- '/house/checkcode' =>'/house/checkcode',
- '/house/sendcode' =>'/house/sendcode',
- '/house/tall' =>'/house/tall',
- '/house/zhongqu/<hid:\w+><t:(/|)>' =>'/house/zhongqu', //VR 详情
- //'/house/<hid:\w+><t:(/|)>' => '/house/home',
- //'/house/<hid:\w+><t:(/|)><city:(\w+|)><s:(/|)>' => '/house/home',
- '/house/<hid:><t:(/|)>' => '/house/home',
- '/knowledgebase/tools' =>'/knowledgebase/tools',
- '/knowledgebase/details/<nid:\w+><t:(/|)>'=>'/knowledgebase/details',
- '/knowledgebase/list/<cid:\w+><t:(/|)>'=>'/knowledgebase/list',
- '/news/details/<nid:\w+><t:(/|)>'=>'/news/details',
- '/news/newshouse'=>'/news/newshouse',
- '/news/<cid:(\w+|)><t:(/|)>'=>'/news/home',
- '/news/'=>'/news/home',
- '/fresh<t:(/|)>'=>'/fresh/home',
- '/city/<cid:\w+><t:(/|)>'=>'/city/index',
- '/map/home<t:(/|)>'=>'/map/home',
- '/pj/details/<pid:\w+><t:(/|)>'=>'/pj/details',
- '/pj<t:(/|)>'=>'/pj/home',
- '/weirdo/details<t:(/|)><qid:\w+><a:(/|)>'=>'/weirdo/details',
- '/weirdo<t:(/|)>'=>'/weirdo/home',
- '<controller:\w+>/<action:\w+>.html'=>'<controller>/<action>',
- '<controller:\w+>/<action:\w+>.php'=>'<controller>/<action>',
- // '/house/search.\w+/<data:\w+>/<page:\w+>' => '/house/search',
- // '/house/search.\w+/<city:\d+>/<price:\d>/<type:\d>/<zhuti:\d>/' => '/house/search',
- // '<controller:\w+>/<action:\w+>/'=>'<controller>/<action>',
- ],
- ],
- 'i18n' => [ //语言配置
- 'translations' => [
- 'app*' => [
- 'class' => 'yii\i18n\PhpMessageSource',
- 'basePath' => '@common/messages',
- // 'sourceLanguage' => 'en',
- 'fileMap' => [
- 'app' => 'app.php',
- // 'app/error' => 'error.php',
- ],
- ],
- // 'model*' => [
- // 'class' => 'yii\i18n\PhpMessageSource',
- // 'basePath' => '@common/messages',
- // 'fileMap' => [
- // 'model' => 'model.php'
- // ]
- // ]
- ],
- ],
- ],
- 'params' => $params,
- 'language' =>'zh-CN',
- ];
|