From a86d3d62a770b64933da710d7fdd911bdca1d918 Mon Sep 17 00:00:00 2001 From: wangyang <1147192855@qq.com> Date: Wed, 3 Apr 2024 09:49:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20lib/common/config/request?= =?UTF-8?q?=5Fconfig.dart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/config/request_config.dart | 43 --------------------------- 1 file changed, 43 deletions(-) delete mode 100644 lib/common/config/request_config.dart diff --git a/lib/common/config/request_config.dart b/lib/common/config/request_config.dart deleted file mode 100644 index af6b9c0..0000000 --- a/lib/common/config/request_config.dart +++ /dev/null @@ -1,43 +0,0 @@ -/* - * @Author: wangyang 1147192855@qq.com - * @Date: 2022-07-13 11:28:23 - * @LastEditors: wangyang 1147192855@qq.com - * @LastEditTime: 2022-09-14 11:17:20 - * @FilePath: \marking_app\lib\config\RequestConfig.dart - * @Description: 请求工具类 - */ -import 'package:school_asignment_app/common/job/common/base_page.dart'; - -class RequestConfig { - static const _devBaseUrl = "https://dpc-teacher-api.23544.com"; // 开发 - static const _proBaseUrl = "https://dpc-teacher-api.23544.com"; // 生产 - - static RequestConfig? _instance; - String baseUrl; - - static const connectTimeout = 8000; // 连接超时 - static const receiveTimeout = 8000; // 接收超时 - static const bool requestDataPrinting = true; // 打印返回数据 - static const bool printSwitch = true; // 打印返回数据 - static const successCode = [204, 200]; // 返回成功code - static final BasePage basePage = BasePage(1, 10); // 分页参数 - - // 私有化构造函数,防止外部直接实例化 -// 私有化构造函数,防止外部直接实例化 - RequestConfig._({required this.baseUrl}); - - factory RequestConfig() { - if (_instance == null) { - late String newBaseUrl; - late String newBaseUrlOfReport; - late String newLoginBaseUrl; - - if (const bool.fromEnvironment('dart.vm.product')) - newBaseUrl = _proBaseUrl; // 生产环境 - else - newBaseUrl = _devBaseUrl; // 开发环境 - _instance = RequestConfig._(baseUrl: newBaseUrl); - } - return _instance!; - } -}