/// API 接口常量 class ApiConstants { ApiConstants._(); // ==================== 基础配置 ==================== /// API 基础地址(需要根据实际环境配置) static const String baseUrl = 'https://api.example.com'; /// API 版本 static const String apiVersion = '/api/v1'; /// 完整的基础 URL static String get baseApiUrl => '$baseUrl$apiVersion'; // ==================== 认证相关 ==================== /// 登录接口 static const String login = '/auth/login'; /// 验证码登录接口 static const String loginWithSms = '/auth/login/sms'; /// 发送验证码接口 static const String sendSmsCode = '/auth/sms/send'; /// 刷新 Token 接口 static const String refreshToken = '/auth/refresh'; /// 登出接口 static const String logout = '/auth/logout'; /// 忘记密码接口 static const String forgotPassword = '/auth/password/forgot'; /// 重置密码接口 static const String resetPassword = '/auth/password/reset'; // ==================== 用户相关 ==================== /// 获取用户信息 static const String getUserInfo = '/user/info'; /// 更新用户信息 static const String updateUserInfo = '/user/info'; /// 修改密码 static const String changePassword = '/user/password'; // ==================== 请求头 ==================== /// Token 请求头名称 static const String tokenHeader = 'Authorization'; /// Token 前缀 static const String tokenPrefix = 'Bearer'; /// Content-Type static const String contentType = 'Content-Type'; /// Application JSON static const String applicationJson = 'application/json'; // ==================== 超时配置 ==================== /// 连接超时时间(秒) static const int connectTimeout = 30; /// 接收超时时间(秒) static const int receiveTimeout = 30; /// 发送超时时间(秒) static const int sendTimeout = 30; }