petsHero-AI/lib/core/api/api_config.dart
2026-03-31 09:42:49 +08:00

44 lines
1.5 KiB
Dart
Raw Permalink 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.

import 'package:flutter/foundation.dart';
/// petsHeroAI API 配置
abstract final class ApiConfig {
/// 调试日志true 时 release 包也输出 debug/info正式包调试用上线前改 false
static const bool debugLogs = false;
/// AES 密钥
static const String aesKey = 'liyP4LkMfP68XvCt';
/// 应用标识 (sentinel)
static const String appId = 'HAndroid';
/// 应用包名
static const String packageName = 'com.petsheroai.app';
/// 预发环境域名
static const String preBaseUrl = 'https://pre-ai.petsheroai.xyz';
//'https://ai.petsheroai.xyz'; //'https://pre-ai.petsheroai.xyz';
/// 生产环境域名
static const String prodBaseUrl = 'https://ai.petsheroai.xyz';
/// 代理入口路径
static const String proxyPath = '/quester/defender/summoner';
/// 调试时本地代理地址(手机无法直连域名时,用电脑做转发)
/// 例如: 'http://192.168.1.100:8010'(电脑 IP
/// 设为 null 则直连预发域名
static const String? debugBaseUrlOverride = null;
/// 当前使用的 baseUrl调试用预发打包用生产
static String get baseUrl {
if (!kDebugMode) return prodBaseUrl;
return debugBaseUrlOverride ?? preBaseUrl;
}
/// 代理入口完整 URL
static String get proxyUrl => '$baseUrl$proxyPath';
/// 单次 HTTP 请求超时(避免弱网/服务端无响应时永久卡住启动流程)
static const Duration httpRequestTimeout = Duration(seconds: 20);
}