Skip to content

Commit

Permalink
把url绝对路径改为相对路径,否则在不使用/作为ContextPath的时候无法访问路径
Browse files Browse the repository at this point in the history
  • Loading branch information
JaysonAlbert committed Jun 22, 2020
1 parent 09da6c2 commit 87ec41a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
12 changes: 11 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.library</groupId>
<artifactId>library</artifactId>
<version>1.1</version>
<packaging>jar</packaging>
<packaging>war</packaging>

<properties>
<file.encoding>UTF-8</file.encoding>
Expand Down Expand Up @@ -114,6 +114,16 @@
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<webappDirectory>src/main/webapp</webappDirectory>
<outputDirectory>/var/lib/tomcat9/webapps</outputDirectory>
<warName>library</warName>
</configuration>
</plugin>
</plugins>
</build>
</project>
6 changes: 3 additions & 3 deletions src/main/webapp/WEB-INF/jsp/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ background-attachment: fixed;">
else {
$.ajax({
type: "POST",
url: "/api/loginCheck",
url: "api/loginCheck",
data: {
id:id ,
passwd: passwd
Expand All @@ -124,15 +124,15 @@ background-attachment: fixed;">
$("#info").text("提示:账号或密码错误!");
} else if (data.stateCode.trim() === "1") {
$("#info").text("提示:登陆成功,跳转中...");
window.location.href="/admin_main.html";
window.location.href="admin_main.html";
} else if (data.stateCode.trim() === "2") {
if(remember){
rememberLogin(id,passwd,remember);
}else {
Cookies.remove('loginStatus');
}
$("#info").text("提示:登陆成功,跳转中...");
window.location.href="/reader_main.html";
window.location.href="reader_main.html";
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/jsp/reader_lend_list.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
})
</script>
</head>
<body background="/img/lizhi.jpg" style=" background-repeat:no-repeat ;
<body background="img/lizhi.jpg" style=" background-repeat:no-repeat ;
background-size:100% 100%;
background-attachment: fixed;">
<div id="header"></div>
Expand Down

0 comments on commit 87ec41a

Please sign in to comment.