忘记密码接口新增

dev
lijingtao 1 year ago
parent e3f0f5edfd
commit 78ef8eaba0

@ -6,12 +6,15 @@ import cn.jyjz.xiaoyao.admin.service.TenantService;
import cn.jyjz.xiaoyao.common.base.controller.BaseController; import cn.jyjz.xiaoyao.common.base.controller.BaseController;
import cn.jyjz.xiaoyao.common.base.vo.ResultVo; import cn.jyjz.xiaoyao.common.base.vo.ResultVo;
import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil; import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil;
import cn.jyjz.xiaoyao.common.redis.cache.ICacheManager;
import cn.jyjz.xiaoyao.common.redis.cache.constants.CacheConstants;
import cn.jyjz.xiaoyao.framework.security.service.SmsLoginService; import cn.jyjz.xiaoyao.framework.security.service.SmsLoginService;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrSUserT; import cn.jyjz.xiaoyao.ocr.dataobject.OcrSUserT;
import cn.jyjz.xiaoyao.ocr.service.OcrISUserTService; import cn.jyjz.xiaoyao.ocr.service.OcrISUserTService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@ -48,6 +51,9 @@ public class OcrSUserTController {
@Resource @Resource
private SmsLoginService smsLoginService; private SmsLoginService smsLoginService;
@Resource
ICacheManager iCacheManager;
/** /**
*/ */
@ApiOperation(value = "重置密码", notes = "重置密码") @ApiOperation(value = "重置密码", notes = "重置密码")
@ -116,7 +122,12 @@ public class OcrSUserTController {
phonewrapper.eq("MOBILE", map.get("phone").toString()).eq("LOGINNAME", map.get("loginname").toString()); phonewrapper.eq("MOBILE", map.get("phone").toString()).eq("LOGINNAME", map.get("loginname").toString());
OcrSUserT phoneone = sUserTService.getOne(phonewrapper); OcrSUserT phoneone = sUserTService.getOne(phonewrapper);
if(null!=phoneone){ if(null!=phoneone){
ResultVo phone = smsLoginService.sendCode(map.get("phone").toString()); String sysCode = iCacheManager.get(CacheConstants.USER_PHONE_MODEL_NAME,map.get("phone").toString());
if(!StringUtils.isBlank(sysCode) && !sysCode.equals(map.get("phone").toString())){
return new ResponseEntity<Object>("通过",HttpStatus.OK);
}else {
return new ResponseEntity<Object>("验证码错误!",HttpStatus.OK);
}
}else { }else {
return new ResponseEntity<Object>("手机号错误!",HttpStatus.OK); return new ResponseEntity<Object>("手机号错误!",HttpStatus.OK);
} }
@ -147,7 +158,6 @@ public class OcrSUserTController {
return new ResponseEntity<Object>(HttpStatus.OK);
} }

Loading…
Cancel
Save