import 'package:dio/dio.dart'; import 'package:lszlgl/config/app_config.dart'; import 'api.dart'; class MyApi { MyApi._(); /// 生产url static String productUrl = 'http://121.36.17.6:39099'; /// 紫光正式 //static String productUrl = 'http://101.36.160.117:39099'; /// 测试url static String testUrl = 'http://121.36.17.6:19090'; static late String globalUrl; static void init(AppEnvironment env) { globalUrl = switch (env) { AppEnvironment.develop => testUrl, AppEnvironment.product => productUrl, }; } static Api get({Dio? dio, String? baseUrl}) { return Api( dio: dio, baseUrl: baseUrl ?? globalUrl, ); } }