|
|
|
@ -2,6 +2,7 @@ package com.ruoyi.store.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.ruoyi.common.utils.SecurityUtils; |
|
|
|
|
import com.ruoyi.framework.domain.Sms; |
|
|
|
|
import com.ruoyi.framework.service.ISmsService; |
|
|
|
|
import com.ruoyi.store.domain.StoreAccount; |
|
|
|
|
import com.ruoyi.store.domain.vo.StoreAccountVo; |
|
|
|
@ -25,7 +26,7 @@ public class StoreAccountServiceImpl implements IStoreAccountService { |
|
|
|
|
private StoreAccountMapper storeAccountMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ISmsService SmsService; |
|
|
|
|
private ISmsService smsService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询店家账号 |
|
|
|
@ -103,7 +104,10 @@ public class StoreAccountServiceImpl implements IStoreAccountService { |
|
|
|
|
@Override |
|
|
|
|
public String register(StoreAccountVo account) { |
|
|
|
|
//检查验证码是否有效
|
|
|
|
|
if (SmsService.existsSms(account.getMobile(), account.getVerificationCode())) { |
|
|
|
|
Sms sms = smsService.querySms(account.getMobile(), account.getVerificationCode()); |
|
|
|
|
if (sms != null) { |
|
|
|
|
sms.setDeadtime(new Date()); |
|
|
|
|
smsService.updateSms(sms); |
|
|
|
|
if (selectAccountByMobile(account.getMobile()) != null) { |
|
|
|
|
return "手机号已注册"; |
|
|
|
|
} else { |
|
|
|
@ -121,7 +125,26 @@ public class StoreAccountServiceImpl implements IStoreAccountService { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
return "无效验证码"; |
|
|
|
|
return "手机号或验证码错误"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String resetpwd(StoreAccountVo account) { |
|
|
|
|
//检查验证码是否有效
|
|
|
|
|
Sms sms = smsService.querySms(account.getMobile(), account.getVerificationCode()); |
|
|
|
|
if (sms != null) { |
|
|
|
|
sms.setDeadtime(new Date()); |
|
|
|
|
smsService.updateSms(sms); |
|
|
|
|
StoreAccount storeAccount = selectAccountByMobile(account.getMobile()); |
|
|
|
|
storeAccount.setPassword(SecurityUtils.encryptPassword(account.getPassword())); |
|
|
|
|
if (storeAccountMapper.updateById(storeAccount) > 0) { |
|
|
|
|
return "密码重置成功"; |
|
|
|
|
} else { |
|
|
|
|
return "密码重置失败"; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
return "手机号或验证码错误"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|