Files
social-app/docs/bugs/根路径定义为登录页.md
T

35 lines
807 B
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.
# 路由语义混乱:根路径 `/` 定义为登录页
## 问题描述
`app_routes.dart` 中根路径 `/` 被定义为登录页:
```dart
static const authBoot = '/boot';
static const authLogin = '/'; // 根路径是登录页
static const homeMain = '/home'; // 首页反而在 /home
```
这导致:
- `/` 应该指向首页的直觉 expectation 违反
- 根路径无法放置真实首页内容
-`homeMain = '/home'` 语义不一致
## 正确做法
根路径 `/` 应保留给首页,登录页应使用独立路径如 `/login`
```dart
static const authLogin = '/login';
static const homeMain = '/';
```
## 相关文件
- `apps/lib/app/router/app_routes.dart`
- `apps/lib/app/router/app_router.dart`
## 修复优先级
**低** - 功能正常,属于历史遗留设计问题