'yii\rest\OptionsAction', 'collectionOptions' => ['PUT', 'GET', 'OPTIONS'] ]; return $action; } public function actionIndex() { return Yii::$app->user->identity; } /** * @return string * @throws \yii\base\Exception * @throws \yii\web\NotFoundHttpException * @throws \yii\web\ServerErrorHttpException */ public function actionToken() { return Login::wxLogin(); } }