use websocket

This commit is contained in:
landaiqing
2024-08-17 20:01:23 +08:00
parent 3140eaca99
commit 0c3edc360c
12 changed files with 223 additions and 21 deletions

View File

@@ -46,7 +46,12 @@ export const service = createAlova({
requestAdapter: axiosRequestAdapter(),
l2Cache: localforageStorageAdapter,
cacheLogger: import.meta.env.VITE_NODE_ENV === 'development',
cacheFor: {},
cacheFor: {
// GET: {
// mode: "restore",
// expire: 1000 * 60 * 60 * 24 * 7 // 7天过期
// }
},
// 设置全局的请求拦截器
beforeRequest: onAuthRequired(async (method: any) => {
if (!method.meta?.ignoreToken) {