Compare commits
No commits in common. "a86d3d62a770b64933da710d7fdd911bdca1d918" and "7b3f4bcb6deaeb4148ccfa5b8dc0551984be3927" have entirely different histories.
a86d3d62a7
...
7b3f4bcb6d
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit d3d8effc686d73e0114d71abdcccef63fa1f25d2
|
||||||
|
|
@ -16,9 +16,6 @@ migrate_working_dir/
|
||||||
*.iws
|
*.iws
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
# 编译文件不上传
|
|
||||||
*.g.dart
|
|
||||||
|
|
||||||
# The .vscode folder contains launch configuration and tasks you configure in
|
# The .vscode folder contains launch configuration and tasks you configure in
|
||||||
# VS Code which you may wish to be included in version control, so this line
|
# VS Code which you may wish to be included in version control, so this line
|
||||||
# is commented out by default.
|
# is commented out by default.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
* @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!;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'user_login.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
UserLogin _$UserLoginFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||||
|
'UserLogin',
|
||||||
|
json,
|
||||||
|
($checkedConvert) {
|
||||||
|
final val = UserLogin(
|
||||||
|
$checkedConvert('access_token', (v) => v as String),
|
||||||
|
$checkedConvert('expires_in', (v) => v as int),
|
||||||
|
$checkedConvert('token_type', (v) => v as String),
|
||||||
|
);
|
||||||
|
return val;
|
||||||
|
},
|
||||||
|
fieldKeyMap: const {
|
||||||
|
'accessToken': 'access_token',
|
||||||
|
'expiresIn': 'expires_in',
|
||||||
|
'tokenType': 'token_type'
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$UserLoginToJson(UserLogin instance) => <String, dynamic>{
|
||||||
|
'access_token': instance.accessToken,
|
||||||
|
'expires_in': instance.expiresIn,
|
||||||
|
'token_type': instance.tokenType,
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue