Преглед на файлове

🐛 fix(admin): 修复图片选择器文件ID类型错误

- 将文件ID从字符串转换为数字类型,解决后端接口参数类型不匹配问题
yourname преди 4 седмици
родител
ревизия
774b6f5669
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      web/src/client/admin/components/ImageSelector.tsx

+ 1 - 1
web/src/client/admin/components/ImageSelector.tsx

@@ -57,7 +57,7 @@ export const ImageSelector: React.FC<ImageSelectorProps> = ({
     queryKey: ['file-detail', value],
     queryFn: async () => {
       if (!value) return null;
-      const response = await fileClient[':id']['$get']({ param: { id: value.toString() } });
+      const response = await fileClient[':id']['$get']({ param: { id: Number(value) } });
       if (response.status !== 200) throw new Error('获取文件详情失败');
       return response.json();
     },