12345678910111213141516171819202122232425262728293031323334 |
- 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';
- /// 紫光 生产正式 url
- static String productUrl = 'http://101.36.160.117:39099';
- /// 测试url
- static String testUrl = 'http://101.36.160.117:31070';
- 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,
- );
- }
- }
|