- 修正API路径参数格式,将[id]改为[:id]以匹配API路由定义 - 解决用户资料无法正确获取的问题
@@ -26,7 +26,7 @@ const UserProfilePage: React.FC = () => {
try {
setLoading(true);
- const response = await userClient[id].$get();
+ const response = await userClient[':id'].$get();
if (!response.ok) throw new Error('获取用户资料失败');