Files
peko-ios/YuMi/Modules/YMMine/Presenter/XPMineVerifIdentityPresenter.m
2023-07-18 18:26:10 +08:00

48 lines
1.5 KiB
Objective-C

//
// YMMineVerifIdentityPresenter.m
// YUMI
//
// Created by YUMI on 2021/9/18.
//
#import "XPMineVerifIdentityPresenter.h"
///Api
#import "Api.h"
///P
#import "XPMineVerifIdentityProtocol.h"
///Tool
#import "AccountInfoStorage.h"
#import "DESEncrypt.h"
#import "YUMIConstant.h"
@implementation XPMineVerifIdentityPresenter
/// 获取手机的验证码
/// @param phone 手机号
/// @param type 类型
- (void)phoneSmsCode:(NSString *)phone type:(GetSmsType)type phoneAreaCode:(NSString *)phoneAreaCode{
NSString * typeStr = [NSString stringWithFormat:@"%lu", (unsigned long)type];
NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)];
[Api phoneSmsCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] phoneSmsCodeSuccess];
} fail:^(NSInteger code, NSString * _Nullable msg) {
}] mobile:desPhone type:typeStr phoneAreaCode:phoneAreaCode];
}
/// 校验手机验证码接口
/// @param moblieNum 手机号码
/// @param code 验证码
- (void)checkMoblieCodeWithMoblie:(NSString *)moblieNum code:(NSString *)code phoneAreaCode:(NSString *)phoneAreaCode{
NSString * uid = [[AccountInfoStorage instance] getUid];
NSString * ticket = [[AccountInfoStorage instance] getTicket];
NSString * desPhone = [DESEncrypt encryptUseDES:moblieNum key:KeyWithType(KeyType_PasswordEncode)];
[Api checkMoblieCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] checkMoblieCodeWithMoblieSuccess];
}] mobile:desPhone code:code uid:uid ticket:ticket phoneAreaCode:phoneAreaCode];
}
@end