getGraphicCaptcha static method

Future<String> getGraphicCaptcha(
  1. int width,
  2. int height
)

获取图形验证码 widthheight

Implementation

static Future<String> getGraphicCaptcha(int width, int height) async {
  String messageId = HttpUtils.getUUID();
  int timestamp = DateTime.now().millisecondsSinceEpoch;
  String sign = CipherUtil.generateSignature(timestamp, messageId);
  Cm005BaseLoginRequest request = Cm005BaseLoginRequest(
      messageId: messageId,
      timestamp: timestamp,
      sign: sign,
      language: 'zh-CN',
      signVerison: '1',
      payLoadVersion: '1',
      payload: Payload(
        token: getTempToken(1).toString(),
        type: 'RandomNumberPicture',
        width: width,
        height: height,
      ));
  var result = await HttpUtils.post(Api.PATH_GET_PHONE_CAPTCHA,
      data: request.toJson());
  return formatResponse(result);
}