控制器添加
public function behaviors()
{
$behaviors = parent::behaviors();
$behaviors['authenticator'] = [
'class' => HttpBearerAuth::className(),
];
return $behaviors;
}
yiifiltersauthHttpHeaderAuth
key value
Authorization : Bearer iGQRM14V7XFfqMpsqvopbmUKqvbUDkcH--1534821581