YII2 RESTful Web服务access-token名称覆盖
YII2 RESTful Web服务access-token名称覆盖public function behaviors()
{
$behaviors = parent::behaviors();
//$behaviors['contentNegotiator']['formats']['text/html'] = Response::FORMAT_HTML;
$behaviors['rateLimiter']['enableRateLimitHeaders'] = TRUE;
$behaviors['authenticator'] = [
'class' => QueryParamAuth::className(),
'tokenParam' => 'key', // 修改access-token为key
/*
'class' => CompositeAuth::className(),
'authMethods' => [
HttpBasicAuth::className(),
HttpBearerAuth::className(),
QueryParamAuth::className(),
],
*/
];
return $behaviors;
}
页:
[1]