mirror of
https://gitee.com/dromara/sa-token.git
synced 2024-12-02 03:47:50 +08:00
sa-token-solon-plugin:调整适配代码,允许没有sa-token配置内容。
This commit is contained in:
parent
c2ad8bf347
commit
59eaed193b
@ -46,23 +46,19 @@ public class XPluginImp implements Plugin {
|
||||
}
|
||||
|
||||
private void beanInitDo(AopContext context) {
|
||||
// 注入上下文Bean
|
||||
SaManager.setSaTokenContext(new SaContextForSolon());
|
||||
|
||||
//注入配置Bean
|
||||
SaTokenConfig saTokenConfig = Solon.cfg().getBean("sa-token", SaTokenConfig.class);
|
||||
if (saTokenConfig == null) {
|
||||
//如果没有,给个默认的
|
||||
saTokenConfig = new SaTokenConfig();
|
||||
saTokenConfig.setIsPrint(false);
|
||||
if (saTokenConfig != null) {
|
||||
SaManager.setConfig(saTokenConfig);
|
||||
}
|
||||
|
||||
SaManager.setConfig(saTokenConfig);
|
||||
|
||||
context.getBeanAsync(SaTokenConfig.class, bean -> {
|
||||
SaManager.setConfig(bean);
|
||||
});
|
||||
|
||||
// 注入上下文Bean
|
||||
SaManager.setSaTokenContext(new SaContextForSolon());
|
||||
|
||||
// 注入Dao Bean
|
||||
context.getBeanAsync(SaTokenDao.class, bean -> {
|
||||
SaManager.setSaTokenDao(bean);
|
||||
|
Loading…
Reference in New Issue
Block a user