fix: 使用 csrfFetch 替换 fetch 以增强 API 请求的安全性

This commit is contained in:
catlog22
2026-01-13 11:42:28 +08:00
parent 6b8e73bd32
commit 4caa622942
11 changed files with 36 additions and 36 deletions

View File

@@ -415,7 +415,7 @@ async function cleanProjectStorage(projectId) {
}
try {
const res = await fetch('/api/storage/clean', {
const res = await csrfFetch('/api/storage/clean', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ projectId })
@@ -451,7 +451,7 @@ async function cleanAllStorageConfirm() {
}
try {
const res = await fetch('/api/storage/clean', {
const res = await csrfFetch('/api/storage/clean', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ all: true })