// // LoginForgetPasswordPresent.m // YUMI // // Created by YUMI on 2021/9/10. // #import "LoginForgetPasswordPresent.h" ///Tool #import "AccountInfoStorage.h" #import "DESEncrypt.h" #import "YUMIConstant.h" ///Api #import "Api+Login.h" ///Presenter #import "LoginForgetPasswordPresent.h" ///Protocol #import "LoginForgetPasswordProtocol.h" @implementation LoginForgetPasswordPresent - (id)getView { return ((id) [super getView]); } /// 获取手机的验证码 /// @param phone 手机号 /// @param type 类型 - (void)phoneSmsCode:(NSString *)phone type:(GetSmsType)type phoneAreaCode:(NSString *)phoneAreaCode{ NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)]; [Api phoneSmsCode:[self createHttpCompletion:^(id _Nonnull data) { [[self getView] phoneSmsCodeSuccess]; }] mobile:desPhone type:[NSString stringWithFormat:@"%lu", (unsigned long)type] phoneAreaCode:phoneAreaCode]; } /// 没有登录的时候 重置密码 /// @param phone 手机号 /// @param newPwd 新的密码 /// @param smsCode 验证码 - (void)resetPassword:(NSString *)phone newPwd:(NSString *)newPwd smsCode:(NSString *)smsCode phoneAreaCode:(NSString *)phoneAreaCode{ NSString * desPassword = [DESEncrypt encryptUseDES:newPwd key:KeyWithType(KeyType_PasswordEncode)]; NSString * desPhone = [DESEncrypt encryptUseDES:phone key:KeyWithType(KeyType_PasswordEncode)]; [Api resetPasswordWithPhone:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [[self getView] resetPasswrodSuccess]; } showLoading:YES] phone:desPhone newPwd:desPassword smsCode:smsCode phoneAreaCode:phoneAreaCode]; } @end