feat(web): pwa offline caching, dockerized SPA, full-stack nginx smoke

This commit is contained in:
2026-09-07 16:33:50 +08:00
parent 1bd7688ee6
commit 96e96fec51
11 changed files with 133 additions and 8 deletions
+4
View File
@@ -47,6 +47,10 @@ export function AuthProvider({ children }: { children: ReactNode }) {
setToken(null);
setTok(null);
qc.clear();
if (typeof caches !== "undefined") {
void caches.delete("booklib-api");
void caches.delete("booklib-immutable");
}
},
}),
[meQ.data, meQ.isPending, meQ.isError, token, qc],
+1
View File
@@ -4,6 +4,7 @@ import { createRoot } from "react-dom/client";
import App from "./App";
import { queryClient } from "./lib/qc";
import "./index.css";
import "./pwa";
createRoot(document.getElementById("root")!).render(
<QueryClientProvider client={queryClient}>
+4
View File
@@ -0,0 +1,4 @@
import { registerSW } from "virtual:pwa-register";
// autoUpdate:新版本静默装好即用;个人应用无需升级确认弹窗
registerSW({ immediate: true });