auth_logic = new AuthLogic(); } /** * 登录接口 * @param LoginRequest $request * @return JsonResponse * @throws GeneralException */ public function login(LoginRequest $request): JsonResponse { $response = $this->auth_logic->login($request->code); return jsonResponse(Response::HTTP_OK, 'success.', $response); } /** * 未登录跳转 * @throws AuthenticationException */ public function unauthorized() { throw new AuthenticationException('Unauthorized.'); } }