0, 'msg' => 'I am index']); } /** * 测试用 * * @return Json * @throws RepositoryException */ public function test(): Json { $userId = $this->request->middleware('userInfo')['user_id'] ?? 0; $user = AccountRepository::getInstance()->info($userId, []); return json(['code' => 0, 'msg' => 'I am test ', 'data' => $user]); } }