增加 web_base_url 配置, 用于配置 web 后台可置于代理子路径下

This commit is contained in:
涵曦
2019-05-10 16:29:55 +00:00
parent 4b7b2f4c27
commit 383dbd1b7b
21 changed files with 124 additions and 73 deletions

View File

@@ -8,10 +8,10 @@
<title>nps register</title>
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="{{.web_base_url}}/static/css/bootstrap.min.css" rel="stylesheet">
<link href="{{.web_base_url}}/static/font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="/static/css/style.css" rel="stylesheet">
<link href="{{.web_base_url}}/static/css/style.css" rel="stylesheet">
</head>
@@ -34,22 +34,22 @@
</div>
<button onclick="register()" type="submit" class="btn btn-primary block full-width m-b">register</button>
<a class="btn btn-sm btn-white btn-block" href="/login/index">login</a>
<a class="btn btn-sm btn-white btn-block" href="{{.web_base_url}}/login/index">login</a>
</form>
</div>
</div>
<script src="/static/js/jquery-2.1.1.js"></script>
<script src="{{.web_base_url}}/static/js/jquery-2.1.1.js"></script>
<script>
function register() {
$.ajax({
type: "POST",
url: "/login/register",
url: "{{.web_base_url}}/login/register",
data: $("form").serializeArray(),
success: function (res) {
alert(res.msg)
if (res.status) {
window.location.href = "/login/index"
window.location.href = "{{.web_base_url}}/login/index"
}
}
})