超管后台 - 修复项目管理设备列表数据为空时返回数据类型不严谨导致页面报错的问题

This commit is contained in:
柳清爽
2025-04-23 18:03:06 +08:00
parent 5c3869c23d
commit 4c4e78026e
2 changed files with 3 additions and 1 deletions

View File

@@ -29,7 +29,7 @@ class ResponseHelper
* @param mixed $data 错误数据 * @param mixed $data 错误数据
* @return \think\response\Json * @return \think\response\Json
*/ */
public static function error($msg = '操作失败', $code = 400, $data = null) public static function error($msg = '操作失败', $code = 400, $data = [])
{ {
return json([ return json([
'code' => $code, 'code' => $code,

View File

@@ -240,6 +240,8 @@ export default function ProjectDetailPage({ params }: { params: { id: string } }
<CardContent> <CardContent>
{isDevicesLoading ? ( {isDevicesLoading ? (
<div className="flex items-center justify-center py-8">...</div> <div className="flex items-center justify-center py-8">...</div>
) : devices.length === 0 ? (
<div className="flex items-center justify-center py-8 text-muted-foreground"></div>
) : ( ) : (
<Table> <Table>
<TableHeader> <TableHeader>