From 770217513056ef60d5a10a705d8f75ca11d7d5af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Sun, 26 Sep 2021 17:18:09 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BF=AE=E5=A4=8D=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/framework/config/SwaggerConfig.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java index 4da3b9949..76d107643 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java @@ -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 securitySchemes() { List apiKeyList = new ArrayList(); - 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 securityReferences = new ArrayList<>(); - securityReferences.add(new SecurityReference(tokenProperties.getHeader(), authorizationScopes)); + securityReferences.add(new SecurityReference(SaManager.getConfig().getTokenName(), authorizationScopes)); return securityReferences; }