requestParams static method

Future<Map> requestParams()

基本参数

Implementation

static Future<Map> requestParams() async {
  if (requestMap == null) {
    requestMap = {
      'appid': Platform.isAndroid
          ? AppInfoUtil.instance!.androidDeviceInfo.androidId
          : Address.appId,
      'appPackage': Address.packageName,
      'channel': Address.channel,
      'from': Platform.isAndroid ? 'android' : 'ios',
      'model': Platform.isAndroid
          ? AppInfoUtil.instance!.androidDeviceInfo.model
          : CodeUtils.iosDeviceCode(
          AppInfoUtil.instance!.iosDeviceInfo.utsname.machine),
      'os': Platform.isAndroid
          ? AppInfoUtil.instance!.androidDeviceInfo.version.release
          : AppInfoUtil.instance!.iosDeviceInfo.systemVersion,
      'screen':
      '${(ScreenUtil().screenWidth * ScreenUtil().pixelRatio)
          .round()}x${(ScreenUtil().screenHeight * ScreenUtil().pixelRatio)
          .round()}',
      'version': AppInfoUtil.instance!.packageInfo.version,
      'lan': await getLocale(),
      'net': await getNetWork()
    };
  }
  requestMap!['timestamp'] =
      DateTime
          .now()
          .millisecondsSinceEpoch + AppConfig.timeAsync;
  requestMap!['channel'] = Address.channel;
  return requestMap!;
}