main.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <?php
  2. $params = array_merge(
  3. require __DIR__ . '/../../common/config/params.php',
  4. require __DIR__ . '/../../common/config/params-local.php',
  5. require __DIR__ . '/params.php',
  6. require __DIR__ . '/params-local.php'
  7. );
  8. return [
  9. 'id' => 'app-wechat',
  10. 'basePath' => dirname(__DIR__),
  11. 'bootstrap' => ['log'],
  12. 'controllerNamespace' => 'wechat\controllers',
  13. 'components' => [
  14. 'request' => [
  15. 'csrfParam' => 'csrf_token_m',
  16. ],
  17. 'user' => [
  18. 'identityClass' => 'common\models\User',
  19. 'enableAutoLogin' => true,
  20. 'identityCookie' => ['name' => '_identity-wechat', 'httpOnly' => true],
  21. ],
  22. 'session' => [
  23. // this is the name of the session cookie used for login on the frontend
  24. 'name' => 'advanced-wechat',
  25. ],
  26. 'hostserver' => [
  27. 'class' => 'common\api\HostServer',
  28. ],
  29. 'log' => [
  30. 'traceLevel' => YII_DEBUG ? 3 : 0,
  31. 'targets' => [
  32. [
  33. 'class' => 'yii\log\FileTarget',
  34. 'levels' => ['error', 'warning'],
  35. ],
  36. // [
  37. // 'class' => 'yii\log\FileTarget',
  38. // 'levels' => ['error', 'warning','info'],
  39. // 'logVars'=>[],
  40. // //表示以yii\db\或者app\models\开头的分类都会写入这个文件
  41. // 'categories'=>['yii\db\*','common\models\*'],
  42. // //表示写入到文件sql.log中年月日记录日志
  43. // 'logFile'=>'@runtime/../logs/sql/sql.log'.date('Ymd'),
  44. // ]
  45. ],
  46. ],
  47. 'errorHandler' => [
  48. 'errorAction' => 'public/error',
  49. ],
  50. 'assetManager' => [
  51. // 'class' => 'yii\web\AssetManager',
  52. // 'appendTimestamp' => true,
  53. // 'forceCopy' => true,
  54. 'bundles' => [
  55. // 'linkAssets' => true,
  56. 'yii\web\YiiAsset' => [
  57. 'js' => [], // 去除 yii.js
  58. 'sourcePath' => null, // 防止在 frontend/web/asset 下生产文件
  59. ],
  60. 'yii\widgets\ActiveFormAsset' => [
  61. 'js' => [], // 去除 yii.activeForm.js
  62. 'sourcePath' => null, // 防止在 frontend/web/asset 下生产文件
  63. ],
  64. 'yii\validators\ValidationAsset' => [
  65. 'js' => [], // 去除 yii.validation.js
  66. 'sourcePath' => null, // 防止在 frontend/web/asset 下生产文件
  67. ],
  68. // 'yii\bootstrap\BootstrapAsset' => [
  69. // 'css' => [], // 去除 bootstrap.css
  70. // 'sourcePath' => null, // 防止在 frontend/web/asset 下生产文件
  71. // ],
  72. 'yii\bootstrap\BootstrapPluginAsset' => [
  73. 'js' => [], // 去除 bootstrap.js
  74. 'sourcePath' => null, // 防止在 frontend/web/asset 下生产文件
  75. ],
  76. 'yii\web\JqueryAsset' => [
  77. 'js' => [], // 去除 jquery.js
  78. 'sourcePath' => null, // 防止在 frontend/web/asset 下生产文件
  79. ],
  80. ],
  81. ],
  82. 'urlManager' => [
  83. 'enablePrettyUrl' => true,
  84. 'showScriptName' => false,
  85. 'enableStrictParsing' => true,
  86. 'rules' => [
  87. '/'=>'index/index',
  88. '/wechat<t:(/|)>'=>'index/index',
  89. '/house/search<t:(/|)>' =>'/house/search',
  90. '/house/abroad<t:(/|)>' =>'/house/abroad',
  91. '/house/searchdatas' =>'/house/searchdatas',
  92. '/house/searchdata' =>'/house/searchdata',
  93. '/house/soncity' =>'/house/soncity',
  94. '/house/news/<hid:\w+><t:(/|)>' =>'/house/news',
  95. '/house/type/<hid:\w+><t:(/|)>' =>'/house/type',
  96. '/house/details/<hid:\w+><t:(/|)>' =>'/house/details',
  97. '/house/periphery/<hid:\w+>' =>'/house/periphery',
  98. '/house/album/<hid:\w+><t:(/|)>' =>'/house/album',
  99. '/house/remarkfrom' => "house/remarkfrom",
  100. '/house/houseremark/<hid:\w+><t:(/|)>' => "/house/houseremark",
  101. '/house/houseloadremark/<hid:\w+><t:(/|)>' => "/house/houseloadremark",
  102. '/house/remarklikesfrom' => '/house/remarklikesfrom',
  103. '/house/remark/<hid:\w+><t:(/|)>' =>'/house/remark',
  104. '/house/remarkdetails/<hid:\w+><t:(/|)>' =>'/house/remarkdetails',
  105. '/house/dynamic' =>'/house/dynamic',
  106. '/house/housetype' =>'/house/housetype',
  107. '/house/housetypeall' =>'/house/housetypeall',
  108. '/house/albumlist' =>'/house/albumlist',
  109. '/house/tall' =>'/house/tall',
  110. '/house/peitao/<hid:\w+>' =>'/house/peitao',
  111. '/house/searchname' =>'/house/searchname',
  112. '/house/licence' =>'/house/licence',
  113. '/news/details/<nid:\w+><t:(/|)>'=>'/news/details',
  114. '/villa/villalist<t:(/|)>' =>'/villa/villalist',
  115. // '/house/<hid:\w+><t:(/|)>' => '/house/home',
  116. '/house/<hid:><t:(/|)>' => '/house/home',
  117. //'/house/loan' => '/house/loan',
  118. '/house/pvimage/<hid:\w+><t:(/|)>' =>'/house/pvimage', // 相册放大浏览页面
  119. '/house/hximage/<hid:\w+><t:(/|)>' =>'/house/hximage', // 户型放大浏览页面
  120. '/house/loan/<hid:><t:(/|)>' => '/house/loan',
  121. '/house/intro/<hid:><t:(/|)>' => '/house/intro',
  122. '/knowledgebase/details/<nid:\w+><t:(/|)>'=>'/knowledgebase/details',
  123. '/knowledgebase/list<t:(/|)>'=>'/knowledgebase/list',
  124. '/knowledgebase/<t:(/|)>'=>'/knowledgebase/index',
  125. '/news/homeform'=>'/news/homeform',
  126. '/news/<cid:(\w+|/|)><t:(/|)>'=>'/news/home',
  127. //奇葩说
  128. '/weirdo/details<t:(/|)><qid:\w+><r:(/|)>'=>'/weirdo/details',
  129. '/weirdo<t:(/|)>'=>'/weirdo/home',
  130. '/pj/details/<pid:\w+><t:(/|)>'=>'/pj/details',
  131. '/pj/homeform'=>'pj/homeform',
  132. '/pj<t:(/|)>'=>'/pj/home',
  133. '/wap<t:(/|)>'=>'/wap/index',
  134. '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
  135. '<controller:\w+>/<action:\w+>.html'=>'<controller>/<action>',
  136. '<controller:\w+>/<action:\w+>.php'=>'<controller>/<action>',
  137. ],
  138. ],
  139. ],
  140. 'params' => $params,
  141. 'language' =>'zh-CN',
  142. ];