Skip to content

Commit

Permalink
💄 引入404、500错误界面,修复前端无代码也可提交的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
izzp committed Nov 5, 2021
1 parent bf75d45 commit 6795d72
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 11 deletions.
57 changes: 57 additions & 0 deletions src/main/resources/public/error/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="none"/>
<title>404 Not Found</title>
<style>
* {
font-family: "Microsoft Yahei",system-ui;
margin: 0;
font-weight: lighter;
text-decoration: none;
text-align: center;
line-height: 2.2em;
}

html, body {
height: 100%;
}

h1 {
font-size: 100px;
line-height: 1em;
}

table {
width: 100%;
height: 100%;
border: 0;
border-collapse: collapse;
}

th, td {
padding: 0.3em 1em;
}
</style>
</head>
<body>
<table>
<tr>
<td>
<table>
<tr>
<td>
<h1>404</h1>
<h3>大事不妙啦!</h3>
<p>你访问的页面不存在或已被删除~<br/>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
57 changes: 57 additions & 0 deletions src/main/resources/public/error/500.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="none"/>
<title>500 SERVER ERROR</title>
<style>
* {
font-family: "Microsoft Yahei",system-ui;
margin: 0;
font-weight: lighter;
text-decoration: none;
text-align: center;
line-height: 2.2em;
}

html, body {
height: 100%;
}

h1 {
font-size: 100px;
line-height: 1em;
}

table {
width: 100%;
height: 100%;
border: 0;
border-collapse: collapse;
}

th, td {
padding: 0.3em 1em;
}
</style>
</head>
<body>
<table>
<tr>
<td>
<table>
<tr>
<td>
<h1>500</h1>
<h3>大事不妙啦!</h3>
<p>服务器错误,请返回重试~<br/>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
26 changes: 15 additions & 11 deletions src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,23 @@ <h1>
</div>
<form action="/submit" method="post" class="form-horizontal">
<div class="controls">
<textarea class="form-control" name="text" rows="6" cols="80"></textarea>
</div>
<div class="controls">
<input class="form-control" name="identifying" type="text" placeholder="识别码"/>
<label>
<textarea class="form-control" name="text" rows="6" cols="100" required=""></textarea>
</label>
</div>
<div class="control-group">
<select class="form-control" name="type">
<option value="cpp">cpp</option>
<option value="java">java</option>
</select>
<div class="controls">
<button class="btn btn-success" type="submit">提交</button>
</div>
<label>
<input class="form-control" name="identifying" type="text" placeholder="识别码"/>
</label>
<label>
<select class="form-control" name="type">
<option value="cpp">cpp</option>
<option value="java">java</option>
</select>
</label>
</div>
<div class="controls">
<button class="btn btn-success" type="submit">提交</button>
</div>
</form>
</div>
Expand Down

0 comments on commit 6795d72

Please sign in to comment.