Delete the user's avatar image
The JWT token in the 'jwt' cookie is verified by the verifyJWT middleware. If valid, the user's ID is extracted from the token and added to request.body.userId. The deleteAvatar controller then handles deleting the user's avatar and returns the response.
DELETE
/api/profile/deleteavatar
curl \
--request DELETE 'http://localhost:xxxx/api/profile/deleteavatar' \
--cookie "jwt=$API_KEY"
Response examples (200)
{
"message": "用户头像删除成功",
"deleted": true
}
Response examples (401)
您未通过身份验证
Response examples (403)
无效的令牌
Response examples (404)
未找到用户错误
Response examples (500)
服务器内部错误