update 优化 SaToken 自定义扩展类 改为配置类注入 便于扩展

2.X
疯狂的狮子li 2 years ago
parent 49c9bdbf32
commit 2a031d7b44

@ -1,7 +1,11 @@
package com.ruoyi.common.satoken.config;
import cn.dev33.satoken.dao.SaTokenDao;
import cn.dev33.satoken.jwt.StpLogicJwtForSimple;
import cn.dev33.satoken.stp.StpInterface;
import cn.dev33.satoken.stp.StpLogic;
import com.ruoyi.common.satoken.core.dao.PlusSaTokenDao;
import com.ruoyi.common.satoken.core.service.SaPermissionImpl;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
@ -18,4 +22,20 @@ public class SaTokenConfiguration {
return new StpLogicJwtForSimple();
}
/**
* (使bean便)
*/
@Bean
public StpInterface stpInterface() {
return new SaPermissionImpl();
}
/**
* dao
*/
@Bean
public SaTokenDao saTokenDao() {
return new PlusSaTokenDao();
}
}

@ -1,3 +1 @@
com.ruoyi.common.satoken.core.dao.PlusSaTokenDao
com.ruoyi.common.satoken.core.service.SaPermissionImpl
com.ruoyi.common.satoken.config.SaTokenConfiguration

Loading…
Cancel
Save