Files
fquiz/web
chengkai3 e45f8109cc fix:[FL-172][高程数据管理页面上传文件提交表单报错]
修复前端文件上传时文件对象未正确传递的问题。

问题根源:
错误信息显示 "Expected UploadFile, received: <class 'str'>, input: undefined",
说明 file 字段传递的不是有效的文件对象。

原因分析:
在 Ant Design Upload 组件中使用 beforeUpload 返回 false 时,
fileList[0].originFileObj 可能为 undefined,导致传递了 undefined 到 FormData。

解决方案:
1. 添加 fallback 逻辑:const file = fileList[0].originFileObj || fileList[0]
2. 添加文件对象有效性检查,确保是 File 或 Blob 实例
3. 提供清晰的错误提示"无效的文件对象"

这样可以确保:
- 兼容不同版本的 Ant Design Upload 组件
- 文件对象始终是有效的 File/Blob 实例
- 用户得到明确的错误反馈

Co-authored-by: multica-agent <github@multica.ai>
2026-06-21 14:08:05 +08:00
..
2026-04-26 00:14:25 +08:00
2026-04-26 00:14:25 +08:00
2026-04-24 15:50:52 +08:00

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.