'app-api', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'modules' => [ 'v1' => [ 'class' => 'api\modules\v1\Module' ] ], 'controllerNamespace' => 'api\controllers', 'components' => [ 'user' => [ 'identityClass' => 'common\models\User', 'enableAutoLogin' => false, // API change to false 'enableSession' => false, // API ++ 'loginUrl' => null // API ++ ], 'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [ [ 'class' => 'yii\log\FileTarget', 'levels' => ['error', 'warning'], ], ], ], 'request' => [ 'class' => '\yii\web\Request', 'enableCookieValidation' => false, 'parsers' => [ 'application/json' => 'yii\web\JsonParser', ], 'cookieValidationKey' => 'O1d232trde1xww-M97_7QvwPo-5QGdkLMp#@#@', ], 'errorHandler' => [ 'errorAction' => 'site/error', ], 'urlManager' => [ 'class' => 'yii\web\UrlManager', 'enablePrettyUrl' => true, 'enableStrictParsing' => true, 'showScriptName' => false, 'rules' => [ '//'=>'/', '/'=>'/', '//'=>'/', // '' => 'site/index', // ['class' => 'yii\rest\UrlRule', 'controller' => 'customer/api', // 'pluralize' => false, // ], // # 定义方法: public function actionSearch($id); 就是search方法传入的参数 // # http://10.10.10.252:599/v1/wishorder/2015-08-11+12:12:12/2015-09-11+12:12:12?access-token=pBJi3hyFsLsTuvUM9paFpWjYRatn3qwS // # 分页:http://10.10.10.252:599/v1/wishorder/2015-08-11+12:12:12/2015-09-11+12:12:12?page=2&access-token=pBJi3hyFsLsTuvUM9paFpWjYRatn3qwS // 'GET v1/wishorder//' => 'v1/wishorder/viewbydate', // 'GET v1/ebayorder//' => 'v1/ebayorder/viewbydate', ] ], 'db' => require __DIR__ . '/../../common/config/db.php' ], 'params' => $params, ];