This commit is contained in:
2026-08-05 14:05:08 +08:00
parent 9ffc9687d0
commit e831ce810b
8 changed files with 39 additions and 37 deletions

View File

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