request->post('range'); try { # session中获取当前登录是否是管理员 $isAdmin = Session::get('user_info.role') === 'admin' ? true : false; // 后续用来判断 if (!$isAdmin) { return $this->error('权限不足', [], 403); } $data = $UtillService->getExportData($range); return $this->success('查询成功', $data); } catch (\Exception $e) { return $this->error('查询失败', [], 500); } } }