ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysLoginController.java
@@ -111,10 +111,8 @@ @GetMapping("getInfo") public AjaxResult getInfo() { AjaxResult ajax = success(); // SysUser user = Objects.requireNonNull(SecurityUtils.getLoginUser()).getUser(); SysUser user = UserHoder.getLoginUser().getUser(); if (null != user.getUserId()) { String message=null; if (secretKeyLogin) { if(null !=user.getDeptId()){ @@ -133,12 +131,10 @@ redisCache.deleteObject(userIdKey); redisCache.deleteObject(userKey); } throw new SecretKeyException("商家已过期请续费使用"); } long between = DateUtil.between(new Date(), DateUtil.endOfDay(dictHosp.getExpirationTime()), DateUnit.DAY); if(between<=30){ // message="还有 "+between+" 天到期 请注意续费! 以免影响正常使用!"; UserHoder.getLoginUser().setMessage("还有 "+between+" 天到期 请注意续费! 以免影响正常使用!"); } }else { @@ -155,6 +151,7 @@ ajax.put("roles", roles); ajax.put("permissions", permissions); ajax.put("securitMessage",UserHoder.getLoginUser().getMessage()); ajax.put("hospName",UserHoder.getLoginUser().getHospName()); } else { Set<String> roles = new HashSet<>(); LambdaQueryWrapper<SysRole> wq = new LambdaQueryWrapper<>(); @@ -175,6 +172,7 @@ ajax.put("permissions", permissions); ajax.put("post",null); ajax.put("securitMessage",null); ajax.put("hospName",UserHoder.getLoginUser().getHospName()); } return ajax; } ltkj-common/src/main/java/com/ltkj/common/core/domain/model/LoginUser.java
@@ -3,7 +3,9 @@ import java.util.Collection; import java.util.Set; import com.baomidou.mybatisplus.annotation.TableField; import com.ltkj.common.core.domain.entity.SysUser; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -79,6 +81,8 @@ private String message; private String hospName; /* */ /** @@ -99,6 +103,16 @@ this.wxUser = wxUser; }*/ public String getHospName() { return hospName; } public void setHospName(String hospName) { this.hospName = hospName; } public String getMessage() { return message; @@ -108,6 +122,7 @@ { this.message = message; } public Long getDeptId() { return deptId; } ltkj-framework/src/main/java/com/ltkj/framework/web/service/SysLoginService.java
@@ -140,12 +140,13 @@ Long userId =loginUser.getUser().getUserId(); SysUser user = userService.getById(userId); if(null !=user && null !=user.getDeptId()){ // loginUser.getUser().setOrgId(user.getOrgId()); if(!SecurityUtils.isAdmin(user.getUserId())){ SysDept sysDept = deptService.getById(user.getDeptId()); if (null != sysDept) { DictHosp dictHosp = hospService.getById(sysDept.getHospId()); if(null !=dictHosp && dictHosp.getSecretKey() !=null && dictHosp.getExpirationTime() !=null){ if(null !=dictHosp){ loginUser.setHospName(dictHosp.getHospAreaName()); if(!SecurityUtils.isAdmin(user.getUserId())){ if(dictHosp.getSecretKey() != null && dictHosp.getExpirationTime() != null){ if (!SecurityUtils.matchesMallMerchantSecretKey(secret,dictHosp.getHospAreaId(),dictHosp.getAreaid(), dictHosp.getExpirationTime(),dictHosp.getSecretKey())) { throw new SecretKeyException("商家已过期请续费使用"); @@ -156,12 +157,12 @@ }else { loginUser.setMessage(null); } }else { throw new SecretKeyException("请缴费使用"); } } } } }else { throw new CustomException("请绑定商家");