mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 08:13:44 +08:00 
			
		
		
		
	!104 修复在swagger配置类中无法读取到satoken配置文件的问题
Merge pull request !104 from 大灰灰大/satoken
This commit is contained in:
		@@ -1,6 +1,7 @@
 | 
			
		||||
package com.ruoyi.framework.config;
 | 
			
		||||
 | 
			
		||||
import cn.dev33.satoken.SaManager;
 | 
			
		||||
import cn.dev33.satoken.config.SaTokenConfig;
 | 
			
		||||
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
 | 
			
		||||
import com.ruoyi.common.utils.StringUtils;
 | 
			
		||||
import com.ruoyi.common.utils.spring.SpringUtils;
 | 
			
		||||
@@ -31,6 +32,8 @@ public class SwaggerConfig {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private SwaggerProperties swaggerProperties;
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private SaTokenConfig saTokenConfig;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 创建API
 | 
			
		||||
@@ -67,7 +70,7 @@ public class SwaggerConfig {
 | 
			
		||||
     */
 | 
			
		||||
    private List<SecurityScheme> securitySchemes() {
 | 
			
		||||
        List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
 | 
			
		||||
		String header = SaManager.getConfig().getTokenName();
 | 
			
		||||
        String header = saTokenConfig.getTokenName();
 | 
			
		||||
		apiKeyList.add(new ApiKey(header, header, In.HEADER.toValue()));
 | 
			
		||||
        return apiKeyList;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user