更新当前用户信息
curl --request PUT \
--url https://api.lmm.best/api/user/self \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"display_name": "<string>",
"password": "<string>",
"original_password": "<string>"
}
'import requests
url = "https://api.lmm.best/api/user/self"
payload = {
"username": "<string>",
"display_name": "<string>",
"password": "<string>",
"original_password": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
username: '<string>',
display_name: '<string>',
password: '<string>',
original_password: '<string>'
})
};
fetch('https://api.lmm.best/api/user/self', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lmm.best/api/user/self"
payload := strings.NewReader("{\n \"username\": \"<string>\",\n \"display_name\": \"<string>\",\n \"password\": \"<string>\",\n \"original_password\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}用户管理
更新当前用户信息
🔐 需要登录(User权限)
PUT
/
api
/
user
/
self
更新当前用户信息
curl --request PUT \
--url https://api.lmm.best/api/user/self \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"display_name": "<string>",
"password": "<string>",
"original_password": "<string>"
}
'import requests
url = "https://api.lmm.best/api/user/self"
payload = {
"username": "<string>",
"display_name": "<string>",
"password": "<string>",
"original_password": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
username: '<string>',
display_name: '<string>',
password: '<string>',
original_password: '<string>'
})
};
fetch('https://api.lmm.best/api/user/self', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lmm.best/api/user/self"
payload := strings.NewReader("{\n \"username\": \"<string>\",\n \"display_name\": \"<string>\",\n \"password\": \"<string>\",\n \"original_password\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}最后修改于 2026年9月23日
⌘I