changePhoneCaptcha static method

Future<String> changePhoneCaptcha(
  1. bool sendCaptchaToOldPhone,
  2. String proof,
  3. String? captcha
)

更换手机号发送验证码 sendCaptchaToOldPhone 是否发送验证码到旧手机 proof 手机号 captcha 向新手机发送验证码

Implementation

static Future<String> changePhoneCaptcha(bool sendCaptchaToOldPhone,String proof,String? captcha) 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',
      signVersion: '1',
      payLoadVersion: '1',
      payload: sendCaptchaToOldPhone ? Payload(
        accessToken: SpUtil().getString(SpUtil.SP_KEY_ACCESS_TOKEN),
        verifyType: 'PhoneReceive',
        proof: proof,
        sendTarget: 'OldBind',
      ) : Payload(
        accessToken: SpUtil().getString(SpUtil.SP_KEY_ACCESS_TOKEN),
        verifyType: 'PhoneReceive',
        proof: proof,
        sendTarget: 'NewBind',
        captcha: captcha,
      ));
  var result = await HttpUtils.post(true, Api.PATH_CHANGE_PHONE_CAPTCHA,
      data: request.toJson());
  return formatResponse(result);
}