fix: adjust swr option

This commit is contained in:
GyDi 2023-03-16 17:03:12 +08:00
parent db99b4cb54
commit 630249d22a
No known key found for this signature in database
GPG Key ID: 9C3AD40F1F99880A
2 changed files with 2 additions and 1 deletions

View File

@ -76,7 +76,7 @@ const Layout = () => {
}, [language]); }, [language]);
return ( return (
<SWRConfig value={{}}> <SWRConfig value={{ errorRetryCount: 3 }}>
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Paper <Paper
square square

View File

@ -27,6 +27,7 @@ export const getAxios = async (force: boolean = false) => {
axiosIns = axios.create({ axiosIns = axios.create({
baseURL: `http://${server}`, baseURL: `http://${server}`,
headers: secret ? { Authorization: `Bearer ${secret}` } : {}, headers: secret ? { Authorization: `Bearer ${secret}` } : {},
timeout: 15000,
}); });
axiosIns.interceptors.response.use((r) => r.data); axiosIns.interceptors.response.use((r) => r.data);
return axiosIns; return axiosIns;