main.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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-backend',
  10. 'basePath' => dirname(__DIR__),
  11. 'controllerNamespace' => 'backend\controllers',
  12. 'language' => 'zh-CN',
  13. 'bootstrap' => ['log'],
  14. 'modules' => [
  15. 'user' => [
  16. 'class' => 'backend\modules\user\Module',
  17. ],
  18. 'ib' => [
  19. 'class' => 'backend\modules\ib\Module',
  20. ],
  21. ],
  22. 'components' => [
  23. 'request' => [
  24. 'csrfParam' => '_csrf-backend',
  25. ],
  26. 'user' => [
  27. 'identityClass' => 'backend\models\MemberIdentity',
  28. 'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
  29. 'loginUrl' => ['account/login'],
  30. 'idParam' => '__id',
  31. 'authTimeoutParam' => '__expire',
  32. 'absoluteAuthTimeoutParam' => '__absoluteExpire',
  33. 'returnUrlParam' => '__returnUrl',
  34. 'as loginCookie' => [
  35. 'class' => 'common\behaviors\LoginCookieBehavior',
  36. ],
  37. ],
  38. 'userIb' => [
  39. 'class' => 'yii\web\User',
  40. 'identityClass' => 'backend\models\MemberIdentity',
  41. 'identityCookie' => ['name' => '_identity-backend-ib', 'httpOnly' => true],
  42. 'loginUrl' => ['account/iblogin'],
  43. 'idParam' => '__id_ib',
  44. 'authTimeoutParam' => '__expire_ib',
  45. 'absoluteAuthTimeoutParam' => '__absoluteExpire_ib',
  46. 'returnUrlParam' => '__returnUrl_ib',
  47. 'as loginCookie' => [
  48. 'class' => 'common\behaviors\LoginCookieBehavior',
  49. ],
  50. ],
  51. 'session' => [
  52. // this is the name of the session cookie used for login on the backend
  53. 'name' => 'advanced-backend',
  54. ],
  55. 'log' => [
  56. 'traceLevel' => YII_DEBUG ? 3 : 0,
  57. 'targets' => [
  58. [
  59. 'class' => 'yii\log\FileTarget',
  60. 'levels' => ['error', 'warning'],
  61. ],
  62. ],
  63. ],
  64. 'errorHandler' => [
  65. 'errorAction' => 'site/error',
  66. ],
  67. 'urlManager' => [
  68. 'enablePrettyUrl' => true,
  69. 'showScriptName' => false,
  70. 'rules' => [
  71. 'pay/notify/<payType>' => 'pay/notify',
  72. 'pay/return/<payType>' => 'pay/return',
  73. 'remit/notify/<remitNo>' => 'remit/notify',
  74. 'ibLogin' => 'account/iblogin',
  75. 'login' => 'account/login',
  76. 'account/openDemo' => 'account/opendemo',
  77. ],
  78. ],
  79. 'assetManager' => [
  80. 'bundles' => [
  81. 'yii\web\JqueryAsset' => [
  82. 'sourcePath' => null,
  83. 'basePath' => '@webroot',
  84. 'baseUrl' => '@web',
  85. 'js' => [
  86. 'ui/js/jquery.1.9.1.min.js',
  87. ],
  88. ],
  89. ],
  90. ],
  91. ],
  92. 'params' => $params,
  93. ];