|
@@ -7,6 +7,7 @@ import 'package:device_info/device_info.dart'; |
|
|
import 'package:dio/adapter.dart'; |
|
|
import 'package:dio/adapter.dart'; |
|
|
import 'package:dio/dio.dart'; |
|
|
import 'package:dio/dio.dart'; |
|
|
import 'package:fluttertoast/fluttertoast.dart'; |
|
|
import 'package:fluttertoast/fluttertoast.dart'; |
|
|
|
|
|
import 'package:imei_plugin/imei_plugin.dart'; |
|
|
import 'package:package_info/package_info.dart'; |
|
|
import 'package:package_info/package_info.dart'; |
|
|
import 'package:zhiying_comm/util/empty_util.dart'; |
|
|
import 'package:zhiying_comm/util/empty_util.dart'; |
|
|
import 'package:zhiying_comm/zhiying_comm.dart'; |
|
|
import 'package:zhiying_comm/zhiying_comm.dart'; |
|
@@ -269,6 +270,10 @@ class NetUtil { |
|
|
params['device_model'] = iosInfo?.name?.toString(); |
|
|
params['device_model'] = iosInfo?.name?.toString(); |
|
|
// 设备ID |
|
|
// 设备ID |
|
|
params['device_id'] = iosInfo?.identifierForVendor?.toString(); |
|
|
params['device_id'] = iosInfo?.identifierForVendor?.toString(); |
|
|
|
|
|
|
|
|
|
|
|
// idfa |
|
|
|
|
|
params['idfa'] = iosInfo?.identifierForVendor?.toString(); |
|
|
|
|
|
|
|
|
} else if (Platform.isAndroid) { |
|
|
} else if (Platform.isAndroid) { |
|
|
AndroidDeviceInfo androidInfo = await DeviceInfoPlugin().androidInfo; |
|
|
AndroidDeviceInfo androidInfo = await DeviceInfoPlugin().androidInfo; |
|
|
// 设备 |
|
|
// 设备 |
|
@@ -279,6 +284,9 @@ class NetUtil { |
|
|
params['device_model'] = androidInfo?.model?.toString(); |
|
|
params['device_model'] = androidInfo?.model?.toString(); |
|
|
// 设备Id |
|
|
// 设备Id |
|
|
params['device_id'] = androidInfo?.androidId?.toString(); |
|
|
params['device_id'] = androidInfo?.androidId?.toString(); |
|
|
|
|
|
|
|
|
|
|
|
// imei |
|
|
|
|
|
params['imei'] = await _getImei(); |
|
|
} |
|
|
} |
|
|
// 应用版本号 |
|
|
// 应用版本号 |
|
|
params["app_version_name"] = packageInfo.version?.toString(); |
|
|
params["app_version_name"] = packageInfo.version?.toString(); |
|
@@ -322,6 +330,16 @@ class NetUtil { |
|
|
return params; |
|
|
return params; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// 获取Android imei |
|
|
|
|
|
static Future<String> _getImei() async{ |
|
|
|
|
|
try{ |
|
|
|
|
|
return await ImeiPlugin.getImei(shouldShowRequestPermissionRationale: true); |
|
|
|
|
|
}catch(e, s){ |
|
|
|
|
|
Logger.error(e, s); |
|
|
|
|
|
} |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// 获取请求缓存成功的数据 |
|
|
/// 获取请求缓存成功的数据 |
|
|
static Future<void> _onCallBackCacheData(OnCache onCache, String cacheKey) async { |
|
|
static Future<void> _onCallBackCacheData(OnCache onCache, String cacheKey) async { |
|
|
// 读取缓存 |
|
|
// 读取缓存 |
|
|