POST /api/v1/auth/password/change
POST
/api/v1/auth/password/change修改密码(变更后使其他会话失效)
请求体
请求数据
Content-Type · application/json
{
"type": "object",
"required": [
"current_password",
"new_password"
],
"properties": {
"current_password": {
"type": "string"
},
"new_password": {
"type": "string"
}
}
}请求示例
cURL
curl -X POST 'http://localhost:8080/api/v1/auth/password/change' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <JWT>'JavaScript
const res = await fetch('http://localhost:8080/api/v1/auth/password/change', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <JWT>'
},
});
const data = await res.json();Python
import requests
res = requests.post(
'http://localhost:8080/api/v1/auth/password/change',
headers={'Accept': 'application/json', 'Authorization': 'Bearer <JWT>'}
)
print(res.json())响应
204成功(无内容)
400请求参数错误
application/json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "not_found"
},
"message": {
"type": "string",
"example": "资源不存在"
}
}
}在线调试
在线调试
凭证仅保存在当前页面内存中自定义请求 Header
