Jelajahi Sumber

🐛 fix(ui): 修复表单按钮类型问题

- AvatarUpload: 为按钮添加type="button"属性,避免默认表单提交行为
- ProfileEditPage: 启用保存按钮的type="submit"属性,确保表单正确提交
yourname 9 bulan lalu
induk
melakukan
84413838ec

+ 1 - 0
src/client/mobile/components/AvatarUpload.tsx

@@ -204,6 +204,7 @@ export const AvatarUpload: React.FC<AvatarUploadProps> = ({
     <div className="relative">
       {/* 头像显示区域 */}
       <button
+        type="button"
         onClick={handleClick}
         disabled={isUploading}
         className="relative rounded-full overflow-hidden transition-all duration-300 hover:scale-105 focus:outline-none focus:ring-2 focus:ring-offset-2"

+ 1 - 1
src/client/mobile/pages/ProfileEditPage.tsx

@@ -492,7 +492,7 @@ const ProfileEditPage: React.FC = () => {
             {/* 保存按钮 */}
             <div className="pt-4">
               <Button
-                // type="submit"
+                type="submit"
                 className="w-full"
                 size="lg"
                 disabled={updateUserMutation.isPending || updateProfileMutation.isPending}