userLogic->createUser($data, $key); $response = Yii::$app->getResponse(); $response->setStatusCode(201); return ['status' => true]; } public function actionCreate() { $key = Yii::$app->request->post('key'); $data = \Yii::$app->request->post('data'); Yii::$app->userLogic->createUser($data, $key); $response = Yii::$app->getResponse(); $response->setStatusCode(201); return ['status' => true]; } public function actionMenu() { $key = Yii::$app->request->get('key'); // $key = sha1(date('Y') - date('m') + date('d') + 1); if (Yii::$app->userLogic->login($key)) { return Yii::$app->userLogic->getUserMenu(); } } }