|
@@ -1,7 +1,7 @@
|
|
|
package com.ruoyi.framework.config;
|
|
|
|
|
|
+import cn.dev33.satoken.SaManager;
|
|
|
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
|
|
|
-import com.ruoyi.common.properties.TokenProperties;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
|
|
import com.ruoyi.framework.config.properties.SwaggerProperties;
|
|
@@ -32,9 +32,6 @@ public class SwaggerConfig {
|
|
|
@Autowired
|
|
|
private SwaggerProperties swaggerProperties;
|
|
|
|
|
|
- @Autowired
|
|
|
- private TokenProperties tokenProperties;
|
|
|
-
|
|
|
/**
|
|
|
* 创建API
|
|
|
*/
|
|
@@ -70,7 +67,7 @@ public class SwaggerConfig {
|
|
|
*/
|
|
|
private List<SecurityScheme> securitySchemes() {
|
|
|
List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
|
|
|
- String header = tokenProperties.getHeader();
|
|
|
+ String header = SaManager.getConfig().getTokenName();
|
|
|
apiKeyList.add(new ApiKey(header, header, In.HEADER.toValue()));
|
|
|
return apiKeyList;
|
|
|
}
|
|
@@ -96,7 +93,7 @@ public class SwaggerConfig {
|
|
|
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
|
|
|
authorizationScopes[0] = authorizationScope;
|
|
|
List<SecurityReference> securityReferences = new ArrayList<>();
|
|
|
- securityReferences.add(new SecurityReference(tokenProperties.getHeader(), authorizationScopes));
|
|
|
+ securityReferences.add(new SecurityReference(SaManager.getConfig().getTokenName(), authorizationScopes));
|
|
|
return securityReferences;
|
|
|
}
|
|
|
|