getDeviceWorkInfo static method

Future<String> getDeviceWorkInfo(
  1. String deviceId
)

获取绑定设备信息 userId app用户id

Implementation

static Future<String> getDeviceWorkInfo(String deviceId) async {
  Map<String,String> headers = {
    'tenantId': '1845f6e58516a7f96058cfb1d2031cf8',
  };
  int timestamp = DateTime.now().millisecondsSinceEpoch;
  String randomStr = CipherUtil.generateRandomString(6);
  Map<String,dynamic> params = {
    'timestamp': timestamp,
    'nonceStr': randomStr,
    'appKey': BaseHttpConstant.APP_DEVICE_STATE_KEY,
    'data': {
      "deviceId": deviceId
    },
  };
  String sign = CipherUtil.generateSignature2(params, ["data"], BaseHttpConstant.APP_DEVICE_STATE_SECRET);
  params['sign'] = sign;
  Options options = Options(
    headers: headers,
    contentType: Headers.jsonContentType,
  );
  var result = await HttpUtils.post(false,Api.PATH_GET_DEVICE_WORK_PARAM_STATE,
      data: params,
      options: options);
  return ApiCm005.formatResponse(result);
}