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