若依开源1.1.4发布
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.framework.shiro.realm;
|
||||
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import org.apache.shiro.authc.AuthenticationInfo;
|
||||
import org.apache.shiro.authc.AuthenticationToken;
|
||||
@ -16,6 +17,7 @@ import org.apache.shiro.subject.PrincipalCollection;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.ruoyi.common.exception.user.CaptchaException;
|
||||
import com.ruoyi.common.exception.user.RoleBlockedException;
|
||||
import com.ruoyi.common.exception.user.UserBlockedException;
|
||||
@ -36,10 +38,10 @@ import com.ruoyi.project.system.user.domain.User;
|
||||
public class UserRealm extends AuthorizingRealm
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(UserRealm.class);
|
||||
|
||||
|
||||
@Autowired
|
||||
private IMenuService menuService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IRoleService roleService;
|
||||
|
||||
@ -113,4 +115,12 @@ public class UserRealm extends AuthorizingRealm
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理缓存权限
|
||||
*/
|
||||
public void clearCachedAuthorizationInfo()
|
||||
{
|
||||
this.clearCachedAuthorizationInfo(SecurityUtils.getSubject().getPrincipals());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
package com.ruoyi.framework.web.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.project.system.config.service.IConfigService;
|
||||
|
||||
/**
|
||||
* RuoYi首创 html调用 thymeleaf 实现参数管理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Component
|
||||
public class ConfigService
|
||||
{
|
||||
@Autowired
|
||||
private IConfigService configService;
|
||||
|
||||
/**
|
||||
* 根据键名查询参数配置信息
|
||||
*
|
||||
* @param configName 参数名称
|
||||
* @return 参数键值
|
||||
*/
|
||||
public String selectConfigByKey(String configKey)
|
||||
{
|
||||
return configService.selectConfigByKey(configKey);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user