From 2ff676bd88b1988479ecd02d2140e9bcbed4e437 Mon Sep 17 00:00:00 2001 From: WenG <450292408@qq.com> Date: Fri, 23 Apr 2021 14:43:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gateway/filter/wg/WebFluxFilter.java | 20 +- .../assets/layui-v2.6.4/layui/css/admin.css | 205 +++++++++++++++++- .../static/wg/{route => }/index.html | 0 src/main/resources/static/wg/login.html | 50 +++++ 4 files changed, 263 insertions(+), 12 deletions(-) rename src/main/resources/static/wg/{route => }/index.html (100%) create mode 100644 src/main/resources/static/wg/login.html diff --git a/src/main/java/ink/wgink/gateway/filter/wg/WebFluxFilter.java b/src/main/java/ink/wgink/gateway/filter/wg/WebFluxFilter.java index f381886..064cc2c 100644 --- a/src/main/java/ink/wgink/gateway/filter/wg/WebFluxFilter.java +++ b/src/main/java/ink/wgink/gateway/filter/wg/WebFluxFilter.java @@ -1,6 +1,5 @@ package ink.wgink.gateway.filter.wg; -import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; @@ -30,18 +29,19 @@ import java.util.List; public class WebFluxFilter implements WebFilter { public static final String SESSION_USER = "SESSION_USER"; - public static final String PAGE_LOGIN = "/wg/route/login.html"; + public static final String PAGE_LOGIN = "/wg/login.html"; - private List unPassPathPatterns = Arrays.asList(new PathPattern[]{ - new PathPatternParser().parse("/wg/api/user/**"), - new PathPatternParser().parse("/wg/api/route/**"), - new PathPatternParser().parse("/wg/route/user/**"), - new PathPatternParser().parse("/wg/route/route/**"), + private List passPathPatterns = Arrays.asList(new PathPattern[]{ + new PathPatternParser().parse("/gw/**"), + new PathPatternParser().parse("/wg/assets/**"), + new PathPatternParser().parse("/wg/api/sign/**"), + new PathPatternParser().parse("/wg/login.html"), + new PathPatternParser().parse(PAGE_LOGIN), }); @Override public Mono filter(ServerWebExchange serverWebExchange, WebFilterChain webFilterChain) { - if (this.isUnPass(serverWebExchange)) { + if (this.isPass(serverWebExchange)) { return webFilterChain.filter(serverWebExchange); } return serverWebExchange.getSession().flatMap(webSession -> { @@ -61,8 +61,8 @@ public class WebFluxFilter implements WebFilter { * @param serverWebExchange * @return */ - private boolean isUnPass(ServerWebExchange serverWebExchange) { - return unPassPathPatterns.stream().allMatch(pathPattern -> pathPattern.matches(serverWebExchange.getRequest().getPath())); + private boolean isPass(ServerWebExchange serverWebExchange) { + return passPathPatterns.stream().anyMatch(pathPattern -> pathPattern.matches(serverWebExchange.getRequest().getPath())); } /** diff --git a/src/main/resources/static/wg/assets/layui-v2.6.4/layui/css/admin.css b/src/main/resources/static/wg/assets/layui-v2.6.4/layui/css/admin.css index 37c179d..e047a87 100644 --- a/src/main/resources/static/wg/assets/layui-v2.6.4/layui/css/admin.css +++ b/src/main/resources/static/wg/assets/layui-v2.6.4/layui/css/admin.css @@ -7,7 +7,8 @@ html { background: #FFFFFF; } -.iframe-container .iframe-box {} +.iframe-container .iframe-box { +} .iframe-container .iframe-box iframe { padding: 0; @@ -39,4 +40,204 @@ html { box-shadow: rgba(0, 0, 0, 0.12) -1px 0px 4px; background: #FFFFFF; padding: 15px; -} \ No newline at end of file +} + +html, body, #LAY_app { + height: 100%; +} + +.layui-layout-body { + overflow: auto; +} + +#LAY-user-login, +.layadmin-user-display-show { + display: block !important; +} + +.layadmin-user-login { + position: relative; + left: 0; + top: 0; + padding: 110px 0; + min-height: 100%; + box-sizing: border-box; +} + +.layadmin-user-login-main { + width: 375px; + margin: 0 auto; + box-sizing: border-box; +} + +.layadmin-user-login-box { + padding: 20px 20px 0 20px; +} + +.layadmin-user-login-header { + text-align: center; +} + +.layadmin-user-login-header h2 { + font-weight: bold; + font-size: 30px; + color: #000; +} + +.layadmin-user-login-header p { + font-weight: 300; + font-size: 20px; + color: #000; +} + +.layadmin-user-login-body .layui-form-item { + position: relative; +} + +.layadmin-user-login-icon { + position: absolute; + left: 1px; + top: 1px; + width: 38px; + line-height: 36px; + text-align: center; + color: #d2d2d2; +} + +.layadmin-user-login-body .layui-form-item .layui-input { + padding-left: 38px; +} + +.layadmin-user-login-codeimg { + max-height: 38px; + width: 100%; + cursor: pointer; + box-sizing: border-box; +} + +.layadmin-user-login-other { + position: relative; + font-size: 0; + line-height: 38px; + padding-top: 20px; +} + +.layadmin-user-login-other > * { + display: inline-block; + vertical-align: middle; + margin-right: 10px; + font-size: 14px; +} + +.layadmin-user-login-other .layui-icon { + position: relative; + top: 2px; + font-size: 26px; +} + +.layadmin-user-login-other a:hover { + opacity: 0.8; +} + +.layadmin-user-jump-change { + float: right; +} + +.layadmin-user-login-footer { + position: absolute; + left: 0; + bottom: 0; + width: 100%; + line-height: 30px; + padding: 20px; + text-align: center; + box-sizing: border-box; + color: rgba(0, 0, 0, .5) +} + +.footer-text { + text-shadow: 1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff; + font-weight: bold; +} + +.layadmin-user-login-footer span { + padding: 0 5px; +} + +.layadmin-user-login-footer a { + padding: 0 5px; + color: rgba(0, 0, 0, .5); +} + +.layadmin-user-login-footer a:hover { + color: rgba(0, 0, 0, 1); +} + +/* 有背景图时 */ +.layadmin-user-login-main[bgimg] { + background-color: #fff; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.05); +} + +/* 主题背景 */ +.ladmin-user-login-theme { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + text-align: center; +} + +.ladmin-user-login-theme ul { + display: inline-block; + padding: 5px; + background-color: #fff; +} + +.ladmin-user-login-theme ul li { + display: inline-block; + vertical-align: top; + width: 64px; + height: 43px; + cursor: pointer; + transition: all .3s; + -webkit-transition: all .3s; + background-color: #f2f2f2; +} + +.ladmin-user-login-theme ul li:hover { + opacity: 0.9 +} + +.layadmin-user-login-main { + border-radius: 5px; + position: absolute; + width: 375px; + top: 50%; + left: 50%; + margin-left: -188px; + margin-top: -158px; + box-sizing: border-box; + background-color: rgba(255, 255, 255, 0.8); +} + +.system-logo { + width: 68px; + height: 68px; + margin-right: 15px; +} + +.system-logo-title { + float: right; + width: 252px; + text-align: left; +} + +.remember-password { + margin-bottom: 20px; +} + +.other-login-box { + text-align: center; + margin-bottom: 15px; +} diff --git a/src/main/resources/static/wg/route/index.html b/src/main/resources/static/wg/index.html similarity index 100% rename from src/main/resources/static/wg/route/index.html rename to src/main/resources/static/wg/index.html diff --git a/src/main/resources/static/wg/login.html b/src/main/resources/static/wg/login.html new file mode 100644 index 0000000..f3f5b83 --- /dev/null +++ b/src/main/resources/static/wg/login.html @@ -0,0 +1,50 @@ + + + + + + 网关管理 + + + + + + + + + + + + \ No newline at end of file