main.php 7.2 KB

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