import 'package:dio/dio.dart'; import 'package:flutter_tracker/dio/api.dart'; import 'package:flutter_tracker/model/submit_model.dart'; /// Description: /// Time : 2021年12月03日 Friday /// Author : liuyuqi.gov@msncn class TrackDao { static Map params = {}; static Future uploadImg( String token, String filePath, String fileName) async { params.addAll({"token": token, "filePath": filePath, "fileName": fileName}); await Dio() .post(Api.uploadImgUrl, queryParameters: params) .then((response) { return SubmitModel.fromJson(response.data); }); return SubmitModel.fromJson({"success": false, "msg": "网络错误"}); } static Future uploadTrack( String token, String telphone, String address, bool health) async { params.addAll({ "token": token, "telphone": telphone, "address": address, "health": health }); await Dio() .post(Api.uploadTrackUrl, queryParameters: params) .then((response) { return SubmitModel.fromJson(response.data); }); return SubmitModel.fromJson({"success": false, "msg": "网络错误"}); } }