diff --git a/gateway/src/main/java/com/bonus/gateway/config/ContextPathConfig.java b/gateway/src/main/java/com/bonus/gateway/config/ContextPathConfig.java index da853af..9ed7392 100644 --- a/gateway/src/main/java/com/bonus/gateway/config/ContextPathConfig.java +++ b/gateway/src/main/java/com/bonus/gateway/config/ContextPathConfig.java @@ -1,42 +1,42 @@ -package com.bonus.gateway.config; - -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.autoconfigure.web.ServerProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.Ordered; -import org.springframework.core.annotation.Order; -import org.springframework.http.HttpStatus; -import org.springframework.http.server.reactive.ServerHttpRequest; -import org.springframework.web.server.ResponseStatusException; -import org.springframework.web.server.WebFilter; - -/** - * @author HeiZi - */ -@Configuration -public class ContextPathConfig { - - @Bean - @ConditionalOnProperty("server.servlet.context-path") - @Order(Ordered.HIGHEST_PRECEDENCE) - public WebFilter contextPathWebFilter(ServerProperties serverProperties){ - String contextPath = serverProperties.getServlet().getContextPath(); - return (serverWebExchange, webFilterChain) ->{ - ServerHttpRequest request = serverWebExchange.getRequest(); - String requestPath = request.getURI().getPath(); - - if(requestPath.contains(contextPath)){ - String newPath = requestPath.replaceFirst(contextPath+"/", ""); - ServerHttpRequest newRequest = request.mutate() - .path(newPath).build(); - return webFilterChain.filter(serverWebExchange.mutate() - .request(newRequest) - .build() - ); - }else { - throw new ResponseStatusException(HttpStatus.NOT_FOUND); - } - }; - } -} \ No newline at end of file +//package com.bonus.gateway.config; +// +//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +//import org.springframework.boot.autoconfigure.web.ServerProperties; +//import org.springframework.context.annotation.Bean; +//import org.springframework.context.annotation.Configuration; +//import org.springframework.core.Ordered; +//import org.springframework.core.annotation.Order; +//import org.springframework.http.HttpStatus; +//import org.springframework.http.server.reactive.ServerHttpRequest; +//import org.springframework.web.server.ResponseStatusException; +//import org.springframework.web.server.WebFilter; +// +///** +// * @author HeiZi +// */ +//@Configuration +//public class ContextPathConfig { +// +// @Bean +// @ConditionalOnProperty("server.servlet.context-path") +// @Order(Ordered.HIGHEST_PRECEDENCE) +// public WebFilter contextPathWebFilter(ServerProperties serverProperties){ +// String contextPath = serverProperties.getServlet().getContextPath(); +// return (serverWebExchange, webFilterChain) ->{ +// ServerHttpRequest request = serverWebExchange.getRequest(); +// String requestPath = request.getURI().getPath(); +// +// if(requestPath.contains(contextPath)){ +// String newPath = requestPath.replaceFirst(contextPath+"/", ""); +// ServerHttpRequest newRequest = request.mutate() +// .path(newPath).build(); +// return webFilterChain.filter(serverWebExchange.mutate() +// .request(newRequest) +// .build() +// ); +// }else { +// throw new ResponseStatusException(HttpStatus.NOT_FOUND); +// } +// }; +// } +//} diff --git a/gateway/src/main/resources/bootstrap.yml b/gateway/src/main/resources/bootstrap.yml index cd56a3d..43e8593 100644 --- a/gateway/src/main/resources/bootstrap.yml +++ b/gateway/src/main/resources/bootstrap.yml @@ -1,10 +1,10 @@ # Tomcat server: port: 9101 - servlet: - context-path: ynRealName +# servlet: +# context-path: ynRealName # Spring -spring: +spring: application: # 应用名称 name: gateway @@ -32,9 +32,9 @@ spring: sentinel: # 取消控制台懒加载 eager: true - transport: - # 控制台地址 - server-addr: @nacos.server@ +# transport: +# # 控制台地址 +# server-addr: @nacos.server@ # nacos配置持久化 datasource: ds1: @@ -54,4 +54,4 @@ management: enabled-by-default: false endpoint: beans: - enabled: false \ No newline at end of file + enabled: false diff --git a/modules/bmw/src/main/resources/bootstrap.yml b/modules/bmw/src/main/resources/bootstrap.yml index 9f83cef..5af7463 100644 --- a/modules/bmw/src/main/resources/bootstrap.yml +++ b/modules/bmw/src/main/resources/bootstrap.yml @@ -16,7 +16,6 @@ server: # servlet: # context-path: /bmw -environment: @profiles.active@ ## Spring spring: diff --git a/modules/bmw/src/main/resources/static/js/publicJs.js b/modules/bmw/src/main/resources/static/js/publicJs.js index bb26ad7..b6e42f8 100644 --- a/modules/bmw/src/main/resources/static/js/publicJs.js +++ b/modules/bmw/src/main/resources/static/js/publicJs.js @@ -1,33 +1,15 @@ //测试路径 let host=window.location.host; -let IP_URL="https://"+host+"/ynRealName"; -//let IP_URL="http://192.168.0.7:9101/ynRealName" -//本地ip -//let IP_URL="http://127.0.0.1:9101/ynRealName" +let IP_URL="http://"+host; + var ctxPath = IP_URL+"/bmw"; var currentHostname = window.location.hostname; -var currentHostname2 = window.location.host; -console.log(currentHostname+":"+currentHostname2) - -// //测试 -// var loginPath = "http://" + currentHostname + ":9200"; -// var systemPath = "http://" + currentHostname + ":1910"; var filePath =IP_URL + "/file"; var fileUrl =IP_URL +"/file"; var oiPlanUrl = IP_URL + "/oiPlan"; -//112.29.103.165:1616 -//正式环境 -// var loginPath = "http://" + currentHostname + ":1616/auth"; -// var systemPath = "http://" + currentHostname + ":1616/system"; -// var filePath = "http://" + currentHostname + ":1616/file"; -// var fileUrl = "http://" + currentHostname + ":1616/file"; -// var planUrl = "http://" + currentHostname + ":1616/ynPlan"; -// var oiPlanUrl = "http://" + currentHostname + ":1616/oiPlan"; - //文件预览 -// let filePreviewUrl = "http://192.168.0.14:8012/onlinePreview?url="; let filePreviewUrl = "http://" + currentHostname + ":8012/onlinePreview?url="; function getContextPath() { @@ -65,4 +47,4 @@ function isWeakPassword(password) { }else{ return false; } -} \ No newline at end of file +} diff --git a/modules/bmw/src/main/resources/static/js/work/Salary/SalaryBookExport.js b/modules/bmw/src/main/resources/static/js/work/Salary/SalaryBookExport.js index 13f648c..90d761d 100644 --- a/modules/bmw/src/main/resources/static/js/work/Salary/SalaryBookExport.js +++ b/modules/bmw/src/main/resources/static/js/work/Salary/SalaryBookExport.js @@ -130,7 +130,7 @@ function photoView(idNumber) { } function exportList(id) { - location.href = ctxPath + '/salaryBookFill/exportExamList?id='+ id; + location.href = ctxPath + '/salaryBookFill/exportExamList?id='+ id + '&token='+ localStorage.getItem("smz-token"); } // 编辑按钮 @@ -155,4 +155,4 @@ function buttonExport(id, permission, pers) { function buttonView(id,permission, pers) { var btn = $(""); return btn.prop("outerHTML"); -} \ No newline at end of file +} diff --git a/modules/bmw/src/main/resources/static/js/work/Salary/SalaryBookFill.js b/modules/bmw/src/main/resources/static/js/work/Salary/SalaryBookFill.js index a69a524..21f9a96 100644 --- a/modules/bmw/src/main/resources/static/js/work/Salary/SalaryBookFill.js +++ b/modules/bmw/src/main/resources/static/js/work/Salary/SalaryBookFill.js @@ -245,7 +245,7 @@ function dataEdit(idNumber) { function exportList(id) { - location.href = ctxPath + '/salaryBookFill/exportExamList?id='+ id; + location.href = ctxPath + '/salaryBookFill/exportExamList?id='+ id + '&token='+ localStorage.getItem("smz-token"); } function submit(id) { @@ -355,4 +355,4 @@ function reloading() { var index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引 parent.layer.close(index); //再执行关闭 window.parent.location.reload(); -} \ No newline at end of file +}