1、Properties

Former-commit-id: 41ebbf4aff299c696356787e94528c058e02e918
master
wangbing 5 years ago
parent 7b4ac951c3
commit c9cc06dbab

@ -65,6 +65,8 @@ import java.util.regex.Pattern;
@ControllerAdvice
public class GlobalController implements ErrorController {
@Value("${r'${server.servlet.context-path}'}")
private String context;
@Value("${r'${web.home.page}'}")
private String homePage;
@Value("${r'${web.login.page}'}")
@ -115,9 +117,10 @@ public class GlobalController implements ErrorController {
return "404";
case 403:
String errorUrl = RequestUtil.getErrorUrl(request);
errorUrl = errorUrl.replaceFirst(context, "");
if ((errorUrl.equals(homePage) || errorUrl.equals("/")) && LocalData.getToken() == null) {
try {
response.sendRedirect("/login.htm");
response.sendRedirect(context + loginPage);
} catch (IOException e) {
e.printStackTrace();
}

@ -34,8 +34,8 @@ public class UrlUtil {
// 端口
int serverPort = request.getServerPort();
// 上下文路径
String contextPath = request.getContextPath();
String context = request.getContextPath();
return String.format(Locale.CHINA, "%s://%s:%d%s%s", scheme, serverName, serverPort, contextPath, url);
return String.format(Locale.CHINA, "%s://%s:%d%s%s", scheme, serverName, serverPort, context, url);
}
}

@ -2,8 +2,7 @@
window.nav = new Vue({
data: {
activeIndex: 'home',
contextPath: '${contextPath?default("")}',
homePath: '${homePath?default("")}',
context: '${context?default("")}',
tip: {
show: function (msg) {
if(msg) {

@ -238,7 +238,6 @@
data: {
activeIndex: 'home',
context: '${context?default("")}',
homePath: '${home?default("")}',
isSubmit: false,
result: [],
select: []
@ -422,7 +421,6 @@
loadingTip: '',
loadingBar: '',
context: '${context?default("")}',
homePath: '${home?default("")}'
},
methods: {
tipShow: function (msg) {

@ -312,7 +312,7 @@
this.addTab({
title: '首页',
name: 'home',
url: '${r"${contextPath}"}/home.htm'
url: '${r"${context}"}/home.htm'
})
},
barStart: function () {

Loading…
Cancel
Save

Powered by TurnKey Linux.