feat(security): JWT 改 HttpOnly Cookie + P2 死依赖清理 + Dockerfile pnpm 化

- #2 JWT HttpOnly Cookie: authSlice/LoginModalContext 不再向 localStorage
  写入 access/refresh/token_type (仅存非敏感 user), 登出/401 时调用
  POST /user/logout/ 清服务端 Cookie; axios withCredentials=true,
  401 无 token 也走 /user/token/refresh/ 空载荷刷新(单飞); WS createWebSocket
  token 参数可省略由 Cookie 鉴权; Navbar/MobileTopNav/Chat/ChatMobile/Bug/
  useRecordHistory 的 localStorage access_token 判断改走登录态
- P2 #10 死依赖清理: 移除 @chakra-ui/react @emotion/react next-themes
  zustand react-lorem-ipsum react-syntax-highlighter qrcode.react
  @types/qrcode; 删 components/ui 整目录与 Markdown/Markdown.tsx;
  删 package-lock.json yarn.lock 仅留 pnpm-lock; untrack tsconfig.tsbuildinfo
- Dockerfile: 弃用 npm install, 改 corepack pnpm@9 --frozen-lockfile
- nginx.conf: API 白名单补 air-quality/weather/currency/shorturl,
  补 /swagger.json 反代
This commit is contained in:
2026-09-08 11:28:26 +08:00
parent 8ad3abadfc
commit 26feb3d277
28 changed files with 319 additions and 13841 deletions
+2 -10
View File
@@ -11,36 +11,29 @@
},
"dependencies": {
"@ant-design/icons": "6.x",
"@chakra-ui/react": "^3.34.0",
"@emotion/react": "^11.14.0",
"@reduxjs/toolkit": "^2.11.2",
"@types/qrcode": "^1.5.6",
"antd": "^6.3.5",
"axios": "^1.14.0",
"dayjs": "^1.11.20",
"dompurify": "^3.4.14",
"highlight.js": "^11.11.1",
"i18next": "^26.0.3",
"i18next-browser-languagedetector": "^8.2.1",
"jszip": "^3.10.1",
"katex": "^0.16.44",
"next-themes": "^0.4.6",
"qrcode": "^1.5.4",
"qrcode.react": "^4.2.0",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-i18next": "^17.0.2",
"react-icons": "^5.6.0",
"react-json-tree": "^0.20.0",
"react-lorem-ipsum": "^1.4.10",
"react-markdown": "^10.1.0",
"react-redux": "^9.2.0",
"react-router-dom": "^7.14.0",
"react-syntax-highlighter": "^16.1.1",
"rehype-highlight": "^7.0.2",
"rehype-katex": "^7.0.1",
"remark-gfm": "^4.0.1",
"remark-math": "^6.0.0",
"zustand": "^5.0.12"
"remark-math": "^6.0.0"
},
"devDependencies": {
"@eslint/js": "^9.39.4",
@@ -49,7 +42,6 @@
"@types/node": "^24.12.0",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@types/react-syntax-highlighter": "^15.5.13",
"@vitejs/plugin-react": "^6.0.1",
"eslint": "^9.39.4",
"eslint-plugin-react-hooks": "^7.0.1",