增加广告组件,个人中心

This commit is contained in:
唐明明
2022-05-27 17:52:17 +08:00
parent 4a635f3570
commit d64bf95b25
269 changed files with 3960 additions and 309 deletions

View File

@@ -1,22 +0,0 @@
import 'dart:convert';
import 'package:http/http.dart' as Http;
class HttpApi {
final String BaseApi = 'http://api.gl.shangkelian.cn/api/';
/// post
ApiPost(String api, {Map? body}) async {
String apiUrl = BaseApi + api;
var url = Uri.parse(apiUrl);
var response = await Http.post(url, body: body);
int newCode = response.statusCode;
Map data = jsonDecode(response.body);
if (newCode == 200) {
print('请求成功返回值$data');
return data;
}
// print(apiUrl);
// print('可选参数${body}');
}
}

7
lib/https/config.dart Normal file
View File

@@ -0,0 +1,7 @@
class HttpConfig {
static const bool isDebug = false;
static const bool offSsl = false;
static const String baseUrl = 'http://api.zh.shangkelian.cn/api/';
static const int connectTimeout = 5000;
static const int receiveTimeout = 5000;
}

14
lib/https/http.dart Normal file
View File

@@ -0,0 +1,14 @@
import 'package:dio/dio.dart';
import 'config.dart';
class HttpApi {
static HttpApi? instance;
HttpApi() {
print('回家啊哈哈');
}
}
void main() {
HttpApi();
}