Merge pull request #591 from Calcium-Ion/no-cache

feat: add Cache-Control header to API requests
This commit is contained in:
Calcium-Ion
2024-12-04 20:53:22 +08:00
committed by GitHub

View File

@@ -6,7 +6,8 @@ export let API = axios.create({
? import.meta.env.VITE_REACT_APP_SERVER_URL
: '',
headers: {
'New-API-User': getUserIdFromLocalStorage()
'New-API-User': getUserIdFromLocalStorage(),
'Cache-Control': 'no-store'
}
});
@@ -16,7 +17,8 @@ export function updateAPI() {
? import.meta.env.VITE_REACT_APP_SERVER_URL
: '',
headers: {
'New-API-User': getUserIdFromLocalStorage()
'New-API-User': getUserIdFromLocalStorage(),
'Cache-Control': 'no-store'
}
});
}