Files
dsh-web/web/README.md
T

27 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# DSH 中文工作台
React 19 + TypeScript + Vite;普通 CSS 响应式布局,没有运行时演示数据。
## 开发与验证
使用 Node.js 22+:
~~~bash
npm ci
npm run dev
npm test
npm run build
~~~
开发服务只监听 127.0.0.1:5173,/api 和 /dsh 代理至 127.0.0.1:8088。生产产物为 dist/,由后端同源提供;不能直接通过 file:// 使用。
## API 与安全
- 根目录 API.md 是接口契约;API 客户端集中在 src/api.ts,可注入 fetch 进行独立单元测试。
- HttpOnly Cookie 登录;CSRF token 仅留在内存,刷新通过 /api/me 重新获取。密码、token 不写入 localStorage。
- 操作失败保留错误,不模拟成功;删除、重启、构建等操作二次确认。
- 备份恢复和升级等待后端契约,当前明确显示不可用说明,不发送猜测接口。
- 单元测试里的 fetch 替身仅用于测试,不打包进生产页面。
当前后端仍在实现部分端点,页面会真实显示其 HTTP 错误。请不要把前端入口存在等同于后端能力已交付。