43 lines
1.3 KiB
Objective-C
43 lines
1.3 KiB
Objective-C
//
|
|
// YMMinePayPwdPresenter.m
|
|
// YUMI
|
|
//
|
|
// Created by YUMI on 2021/9/18.
|
|
//
|
|
|
|
#import "XPMinePayPwdPresenter.h"
|
|
///Api
|
|
#import "Api+Mine.h"
|
|
///P
|
|
#import "XPMinePayPwdProtocol.h"
|
|
///Tool
|
|
#import "DESEncrypt.h"
|
|
#import "YUMIConstant.h"
|
|
#import "AccountInfoStorage.h"
|
|
|
|
@implementation XPMinePayPwdPresenter
|
|
|
|
/// 获取手机的验证码
|
|
/// @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];
|
|
}] mobile:desPhone type:typeStr phoneAreaCode:phoneAreaCode];
|
|
}
|
|
|
|
/// 设置支付密码
|
|
/// @param password 支付密码
|
|
|
|
- (void)setPayPassword:(NSString *)password {
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
|
NSString * newpasswordDes = [DESEncrypt encryptUseDES:password key:KeyWithType(KeyType_PasswordEncode)];
|
|
[Api setPayPassword:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
|
[[self getView] setPayPasswordSuccess];
|
|
}] newPasswd:newpasswordDes uid:uid ticket:ticket];
|
|
}
|
|
@end
|