fix: 401 errors on user management page

This commit is contained in:
Feng Yue
2025-08-13 15:26:09 +08:00
parent 2a0be1b187
commit 1ad720304c
4 changed files with 41 additions and 23 deletions

View File

@@ -149,6 +149,24 @@ class ApiClient {
}
}
// PATCH 请求
async patch(url, data = null, options = {}) {
const fullUrl = createApiUrl(url)
const config = this.buildConfig({
...options,
method: 'PATCH',
body: data ? JSON.stringify(data) : undefined
})
try {
const response = await fetch(fullUrl, config)
return await this.handleResponse(response)
} catch (error) {
console.error('API PATCH Error:', error)
throw error
}
}
// DELETE 请求
async delete(url, options = {}) {
const fullUrl = createApiUrl(url)