|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
x
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;
- }
复制代码 |
|