diff --git a/sop-admin/sop-admin-server/pom.xml b/sop-admin/sop-admin-server/pom.xml index 1d9ab2ad..88c3db07 100644 --- a/sop-admin/sop-admin-server/pom.xml +++ b/sop-admin/sop-admin-server/pom.xml @@ -41,8 +41,8 @@ net.oschina.durcframework - easyopen - 1.16.5 + easyopen-spring-boot-starter + 1.16.6.1 diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/common/WebContext.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/common/WebContext.java index 41797b5e..f934474d 100644 --- a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/common/WebContext.java +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/common/WebContext.java @@ -26,11 +26,11 @@ public class WebContext { */ public AdminUserInfo getLoginUser() { String sessionId = getSessionId(); - HttpSession session = getSessionManager().getSession(sessionId); - if (session == null) { + if (sessionId == null) { return null; } - if (!session.getId().equals(sessionId)) { + HttpSession session = getSessionManager().getSession(sessionId); + if (session == null) { return null; } return (AdminUserInfo) session.getAttribute(S_USER); diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/config/WebConfig.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/config/WebConfig.java index 2284a716..3587e2c3 100644 --- a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/config/WebConfig.java +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/config/WebConfig.java @@ -14,14 +14,11 @@ import com.gitee.sop.adminserver.service.impl.RegistryServiceEurekaImpl; import com.gitee.sop.adminserver.service.impl.RegistryServiceNacosImpl; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.math.NumberUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.core.env.Environment; -import javax.annotation.PostConstruct; import javax.servlet.http.HttpServletRequest; @@ -36,9 +33,6 @@ public class WebConfig { @Value("${admin.access-token.timeout-minutes}") private String accessTokenTimeout; - @Autowired - private Environment environment; - @Bean ApiConfig apiConfig() { ApiConfig apiConfig = new ApiConfig(); @@ -93,8 +87,5 @@ public class WebConfig { return new RegistryServiceEurekaImpl(); } - @PostConstruct - public void after() { - } } \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/controller/IndexController.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/controller/IndexController.java deleted file mode 100644 index a2b6b8e0..00000000 --- a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/controller/IndexController.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.gitee.sop.adminserver.controller; - -import com.gitee.easyopen.ApiConfig; -import com.gitee.easyopen.support.ApiController; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -/** - * api入口 - */ -@Controller -@RequestMapping("api") -public class IndexController extends ApiController { - - @Value("${easyopen.show-doc:false}") - private String showDoc; - - @Override - protected void initApiConfig(ApiConfig apiConfig) { - apiConfig.setShowDoc(Boolean.valueOf(showDoc)); - apiConfig.setIgnoreValidate(true); - } -} diff --git a/sop-admin/sop-admin-server/src/main/resources/application-dev.properties b/sop-admin/sop-admin-server/src/main/resources/application-dev.properties index 62b798f0..d3995efc 100644 --- a/sop-admin/sop-admin-server/src/main/resources/application-dev.properties +++ b/sop-admin/sop-admin-server/src/main/resources/application-dev.properties @@ -11,7 +11,7 @@ mysql.password=root nacos.url=127.0.0.1:8848 # ------- 需要改的配置end ------- -# token过期时间,分钟 +# session过期时间,分钟 admin.access-token.timeout-minutes=30 # 签名方式,rsa:支付宝开放平台签名方式,md5:淘宝开放平台签名方式 sop.sign-type=rsa