fix:1、短信验证码登录,解决前端菜单权限列表为空bug; #150

Merged
cuihaojie merged 1 commits from fix/Modify_Reset_password_authentication into test 1 year ago

@ -136,7 +136,7 @@ public class MyAuthenticationProvider implements AuthenticationProvider {
//判断账号是否存在 //判断账号是否存在
if(!"admin".equals(loginname) && userTokenService.listLoginNameCount(agentcode,loginname).intValue() <= 0){ if(!"admin".equals(loginname) && userTokenService.listLoginNameCount(agentcode,loginname).intValue() <= 0){
throw new AuthenticationServiceException("账号不存在!"); throw new AuthenticationServiceException("账号或企业编码不存在!");
} }
//数据库查询用户对象 //数据库查询用户对象

@ -630,6 +630,8 @@ public class UserServiceImpl extends BaseServiceImpl<UserMybatisDao,User> imple
User user = this.usermybatisdao.selectById(id); User user = this.usermybatisdao.selectById(id);
if(null != user){ if(null != user){
List<SFrontmenuT> frontmenuTList1 = isFrontmenuTService.queryUserMenuById(user.getLoginname());
user.setFrontmenuTList(frontmenuTList1);
List<Department> departmentList = this.departmentMybatisDao.selectDeptByUserid(user.getId()); List<Department> departmentList = this.departmentMybatisDao.selectDeptByUserid(user.getId());
user.formatDeptlist(departmentList); user.formatDeptlist(departmentList);
//user.setTenantList(this.userTenantService.listUserTenant(user.getId())); //user.setTenantList(this.userTenantService.listUserTenant(user.getId()));

@ -10,6 +10,7 @@ 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 cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService; import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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;
@ -64,9 +65,29 @@ public class OcrSUserTController {
if(null !=map.get("rePasswrod")){ if(null !=map.get("rePasswrod")){
if(map.get("newPassword").equals(map.get("rePasswrod"))){ if(map.get("newPassword").equals(map.get("rePasswrod"))){
// BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
// UpdateWrapper<OcrSUserT> updatewrapper = new UpdateWrapper<>();
// updatewrapper.eq("MOBILE", map.get("loginname")).set("PASSWORD",bCryptPasswordEncoder.encode(map.get("newPassword")));
String MOBILE = "";
BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder(); BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
if(StringUtils.isNotBlank(map.get("loginname"))){
LambdaQueryWrapper<OcrSUserT> ocrSUserTLambdaQueryWrapper = new LambdaQueryWrapper<>();
ocrSUserTLambdaQueryWrapper.eq(OcrSUserT::getLoginname, map.get("loginname"));
OcrSUserT ocrSUserT = sUserTService.getOne(ocrSUserTLambdaQueryWrapper);
if(ocrSUserT != null){
MOBILE = ocrSUserT.getMobile();
}
}else {
return ResultVoUtil.success(ResultVo.SUCCESS,"请输入登录名!");
}
UpdateWrapper<OcrSUserT> updatewrapper = new UpdateWrapper<>(); UpdateWrapper<OcrSUserT> updatewrapper = new UpdateWrapper<>();
updatewrapper.eq("MOBILE", map.get("loginname")).set("PASSWORD",bCryptPasswordEncoder.encode(map.get("newPassword"))); // updatewrapper.eq("MOBILE", map.get("loginname")).set("PASSWORD",bCryptPasswordEncoder.encode(map.get("newPassword")));
// updatewrapper.eq("MOBILE", map.get("loginname"))
// .set("PASSWORD",bCryptPasswordEncoder.encode(map.get("newPassword")));
updatewrapper.eq("MOBILE", MOBILE)
.eq("LOGINNAME", map.get("loginname"))
.set("PASSWORD",bCryptPasswordEncoder.encode(map.get("newPassword")));
boolean update = sUserTService.update(updatewrapper); boolean update = sUserTService.update(updatewrapper);
if(update){ if(update){

Loading…
Cancel
Save