处理警告问题

This commit is contained in:
2022-05-26 14:26:37 +08:00
parent 4a635f3570
commit a6897f6324
73 changed files with 452 additions and 93 deletions

View File

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