|
@@ -6,8 +6,13 @@
|
|
package org.eco.vip.security.config;
|
|
package org.eco.vip.security.config;
|
|
|
|
|
|
|
|
|
|
|
|
+import cn.dev33.satoken.jwt.StpLogicJwtForSimple;
|
|
|
|
+import cn.dev33.satoken.stp.StpInterface;
|
|
|
|
+import cn.dev33.satoken.stp.StpLogic;
|
|
import org.eco.vip.orm.factory.YmlPropertySourceFactory;
|
|
import org.eco.vip.orm.factory.YmlPropertySourceFactory;
|
|
|
|
+import org.eco.vip.security.core.SaPermissionImpl;
|
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.PropertySource;
|
|
import org.springframework.context.annotation.PropertySource;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -19,4 +24,19 @@ import org.springframework.context.annotation.PropertySource;
|
|
@PropertySource(value = "classpath:satoken-common.yml", factory = YmlPropertySourceFactory.class)
|
|
@PropertySource(value = "classpath:satoken-common.yml", factory = YmlPropertySourceFactory.class)
|
|
@AutoConfiguration
|
|
@AutoConfiguration
|
|
public class SaTokenConfig {
|
|
public class SaTokenConfig {
|
|
|
|
+
|
|
|
|
+ @Bean
|
|
|
|
+ public StpLogic getStpLogicJwt() {
|
|
|
|
+ // Sa-Token 整合 jwt (简单模式)
|
|
|
|
+ return new StpLogicJwtForSimple();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 权限接口实现(使用bean注入方便用户替换)
|
|
|
|
+ */
|
|
|
|
+ @Bean
|
|
|
|
+ public StpInterface stpInterface() {
|
|
|
|
+ return new SaPermissionImpl();
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|