import 'package:domain/constants/api_constants.dart'; import 'package:get/get.dart'; import 'package:plugin_basic/constants/app_constant.dart'; import 'package:plugin_basic/service/app_config_service.dart'; import 'package:plugin_basic/service/http_provider_injection.dart'; import 'package:plugin_platform/engine/sp/sp_util.dart'; import 'package:shared/utils/log_utils.dart'; class SelectCountryController extends GetxController { //设置下一步 void setupNext() { int country = ConfigService.to.selectCountry.value; SPUtil.putInt(AppConstant.storageSelectedCountry, country); String baseUrl; if (country == 1) { //新加坡 baseUrl = ApiConstants.sgBaseUrl; } else if (country == 2) { //韩国 baseUrl = ApiConstants.koreaBaseUrl; } else { baseUrl = ApiConstants.baseUrl; } Log.d("当前选择的国家:$country 当前要切换的域名为:$baseUrl"); HttpProviderInjection.switchBaseUrl(baseUrl); Get.back(); } }