[高] 前端登录FormData与Content-Type不匹配 #75
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题描述
frontend/src/stores/user.ts 第30-38行,登录请求使用 FormData 构建请求体,但没有设置 Content-Type: multipart/form-data(axios默认 application/json),导致后端无法正确解析表单数据。
涉及文件
修复建议
使用 JSON 格式发送登录请求,或确保 Content-Type 与 body 格式一致。
严重程度
高 - 用户登录失败