超管后台 - 修复项目管理设备列表数据为空时返回数据类型不严谨导致页面报错的问题
This commit is contained in:
@@ -29,7 +29,7 @@ class ResponseHelper
|
||||
* @param mixed $data 错误数据
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public static function error($msg = '操作失败', $code = 400, $data = null)
|
||||
public static function error($msg = '操作失败', $code = 400, $data = [])
|
||||
{
|
||||
return json([
|
||||
'code' => $code,
|
||||
|
||||
@@ -240,6 +240,8 @@ export default function ProjectDetailPage({ params }: { params: { id: string } }
|
||||
<CardContent>
|
||||
{isDevicesLoading ? (
|
||||
<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>
|
||||
<TableHeader>
|
||||
|
||||
Reference in New Issue
Block a user