---
title: "AJAX保存个人资料"
method: POST
path: "/user/update-profile"
tags: ["前台-用户"]
---

# AJAX保存个人资料

`POST /user/update-profile`

## Request body

- DefineUserApiUpdateProfileReq
  - `avatar` string — 头像地址
  - `gender` integer — 性别 0: 未设置 1: 男 2: 女
  - `id` integer — 用户ID
  - `nickname` string — 昵称

## Response `200`

请求结果

- ResponseJsonRes
  - `code` integer — 错误码((0:成功, 1:失败, >1:错误码))
  - `data` object — 返回数据(业务接口定义具体数据结构)
  - `message` string — 提示信息
  - `redirect` string — 引导客户端跳转到指定路由

## Changes

- **2020-11-23** `5360f0b5286c` — 2 info
  - api tag `前台-用户` added
  - api tag `用户` removed
- **2020-11-02** `223534815f05` — 1 info
  - endpoint added
- **2020-10-30** `71161e2ef517` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/gogf/apis/goframe-api/changes/user/update-profile/post.md)

---

[API](https://skmtc.dev/gogf/apis/goframe-api.md) · [All operations](https://skmtc.dev/gogf/apis/goframe-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gogf/goframe-api/revisions/d05fe905b682/schema)
