- 新增 SplashPage(启动页)和 LoginPage(登录页),支持路由跳转 - 扩展 AuthState,增加 submitting/alert/busy 状态及消费机制 - AuthController 增加 checkLoginState/register/showAlert 等方法 - 删除旧模型文件(binding_item, token_response, verify_response) - 删除旧版 LoginPage,迁移至 features/auth 目录 - 更新本地化字符串,增加注册相关文案 - 调整默认 API 地址为本地开发环境
41 lines
1.2 KiB
Dart
41 lines
1.2 KiB
Dart
import 'package:go_router/go_router.dart';
|
|
|
|
import '../../features/auth/presentation/pages/login_page.dart';
|
|
import '../../features/auth/presentation/pages/splash_page.dart';
|
|
import '../../features/connection/presentation/pages/control_page.dart';
|
|
import '../../features/connection/presentation/pages/setup_page.dart';
|
|
|
|
/// 应用路由。
|
|
///
|
|
/// - `/splash`:启动页,恢复并校验令牌后重定向(初始路由)
|
|
/// - `/login`:登录页,支持通过 `message` 查询参数展示失效提示
|
|
/// - `/`:连接设置页
|
|
/// - `/control`:控制面板页
|
|
final appRouter = GoRouter(
|
|
initialLocation: '/splash',
|
|
routes: [
|
|
GoRoute(
|
|
path: '/splash',
|
|
name: 'splash',
|
|
builder: (context, state) => const SplashPage(),
|
|
),
|
|
GoRoute(
|
|
path: '/login',
|
|
name: 'login',
|
|
builder: (context, state) => LoginPage(
|
|
message: state.uri.queryParameters['message'],
|
|
),
|
|
),
|
|
GoRoute(
|
|
path: '/',
|
|
name: 'setup',
|
|
builder: (context, state) => const SetupPage(),
|
|
),
|
|
GoRoute(
|
|
path: '/control',
|
|
name: 'control',
|
|
builder: (context, state) => const ControlPage(),
|
|
),
|
|
],
|
|
);
|