Skip to content

fix: 支持 TinyVue 前端独立启动 - #232

Draft
hexqi wants to merge 1 commit into
devfrom
fix/tinyvue-standalone-dev
Draft

fix: 支持 TinyVue 前端独立启动#232
hexqi wants to merge 1 commit into
devfrom
fix/tinyvue-standalone-dev

Conversation

@hexqi

@hexqi hexqi commented Jul 31, 2026

Copy link
Copy Markdown

背景

TinyVue 前端无法在不启动 NestJS 或 Spring Boot 后端的情况下独立运行。原有 mock 服务依赖浏览器环境 API,启动时会触发 localStorage is not defined,同时既有 mock 路由和响应结构已与当前前端接口契约不一致。

改动

  • 将默认开发命令调整为同时启动 Vite 与本地 mock 服务
  • 增加支持动态路径参数、请求体和状态码的轻量 HTTP mock 路由
  • 补齐登录、令牌刷新、用户、角色、菜单、权限、语言及国际化接口
  • 修正 Vite 的 mock/真实后端代理切换与 /api 路径处理
  • 移除登录页硬编码假 token,统一走真实登录流程
  • 增加 mock 单元测试和移动端登录导航 E2E 覆盖

影响

运行 pnpm start 即可独立启动 TinyVue 前端;需要连接真实后端时可运行 pnpm dev:full。默认 mock 账号为 admin@no-reply.com / admin

验证

  • pnpm test:mock:14/14 通过
  • mock 服务定向 TypeScript 检查:通过
  • 相关 ESLint 检查:通过
  • pnpm build:通过
  • Pixel 5 Playwright E2E:5/5 通过
  • 代码审查:未发现剩余 Critical/Important 问题

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: be4eff68-2896-4822-82a0-e7c1d19c25fd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the bug Something isn't working label Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant