RQHTTPService+RQVerificationSmsCode.m 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // RQHTTPService+RQVerificationSmsCode.m
  3. // YueXueChe
  4. //
  5. // Created by 张嵘 on 2019/1/14.
  6. // Copyright © 2019 RONG. All rights reserved.
  7. //
  8. #import "RQHTTPService+RQVerificationSmsCode.h"
  9. @implementation RQHTTPService (RQVerificationSmsCode)
  10. /**
  11. 验证码验证
  12. @param mobile 用户登录账号
  13. @param type 类型 1 注册验证码 2找回密码 3试学
  14. @param code 验证码
  15. @return Returns a signal which will send complete, or error
  16. */
  17. - (RACSignal *)verificationSmsCodeWithMobile:(NSString *)mobile type:(RQSMSCodeType)type code:(NSString *)code {
  18. /// 1. 配置参数
  19. RQKeyedSubscript *subscript = [RQKeyedSubscript subscript];
  20. subscript[@"mobile"] = mobile;
  21. subscript[@"type"] = @(type);
  22. subscript[@"code"] = code;
  23. /// 2. 配置参数模型
  24. RQURLParameters *paramters = [RQURLParameters urlParametersWithMethod:RQ_HTTTP_METHOD_POST path:@"" parameters:subscript.dictionary];
  25. /// 3.发起请求
  26. return [[[RQHTTPRequest requestWithParameters:paramters]
  27. enqueueResultClass:nil]
  28. rq_parsedResults];
  29. }
  30. @end