超管后台 - 修复项目管理设备列表数据为空时返回数据类型不严谨导致页面报错的问题
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user