修改访问不了静态页面问题

This commit is contained in:
暮光:城中城
2019-01-24 19:11:39 +08:00
committed by zhanghongli
parent 7703590938
commit 8c58e27196
43 changed files with 126 additions and 142 deletions

View File

@@ -36,7 +36,7 @@ public class Application extends SpringBootServletInitializer {
String urlCtx = hostAddress + ":" + serverPort + "/" + contextPath; String urlCtx = hostAddress + ":" + serverPort + "/" + contextPath;
logger.info("\n----------------------------------------------------------\n\t" + logger.info("\n----------------------------------------------------------\n\t" +
"\t\t地址列表\n\t" + "\t\t地址列表\n\t" +
"管理地址http://{}statics/manage/home.html\n" + "管理地址http://{}static/manage/home.html\n" +
"----------------------------------------------------------", "----------------------------------------------------------",
urlCtx urlCtx
); );

View File

@@ -39,12 +39,12 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
*/ */
@Override @Override
public void configure(WebSecurity web) throws Exception { public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/statics/lib/**", "/css/**", "/js/**", "/img/**"); web.ignoring().antMatchers("/static/lib/**", "/css/**", "/js/**", "/img/**");
} }
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
String loginPage = "/statics/manage/login.html"; String loginPage = "/static/manage/login.html";
http.authorizeRequests().antMatchers("/login/**").permitAll()//为了测试其他功能,设置“ /** ”允许所有请求 http.authorizeRequests().antMatchers("/login/**").permitAll()//为了测试其他功能,设置“ /** ”允许所有请求
.antMatchers("/document.html", "/doc.html").hasAuthority("DOC_ALL") .antMatchers("/document.html", "/doc.html").hasAuthority("DOC_ALL")
@@ -135,4 +135,4 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
return myFilter; return myFilter;
} }
} }

View File

@@ -1,30 +1,14 @@
spring: spring:
application: application:
name: zyplayer-doc-manage name: zyplayer-doc-manage
velocity: # mvc:
layout-url: common/default.vm # static-path-pattern: /**
cache: false
suffix: .vm
expose-spring-macro-helpers: true
date-tool-attribute: dateTool
number-tool-attribute: numberTool
contentType: text/html;charset=UTF-8
resource-loader-path: classpath:/vm/
default-content-type: text/html
ignore-accept-header: true
charset: UTF-8
properties:
input:
encoding: UTF-8
output:
encoding: UTF-8
server: server:
port: 8082 port: 8082
servlet: servlet:
context-path: /zyplayer-doc-manage context-path: /zyplayer-doc-manage
zyplayer: zyplayer:
doc: doc:
# zyplayer_doc_manage管理端的数据库配置 # zyplayer_doc_manage管理端的数据库配置
@@ -74,8 +58,8 @@ mybatis-plus:
configuration: configuration:
map-underscore-to-camel-case: true map-underscore-to-camel-case: true
cache-enabled: false cache-enabled: false
#一些测试地址 #一些测试地址
#https://gitee.com/GeekPerson/central-platform 项目的文档 #https://gitee.com/GeekPerson/central-platform 项目的文档
#http://47.99.88.28:9200/swagger-resources #http://47.99.88.28:9200/swagger-resources

View File

@@ -1,14 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
<title>403错误页面</title> <title>403错误页面</title>
<style> <style>
</style> </style>
<div style="text-align: center;">您没有权限访问此页面</div> <div style="text-align: center;">您没有权限访问此页面</div>
</body> </body>
</html> </html>

View File

@@ -1,14 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
<title>404错误页面</title> <title>404错误页面</title>
<style> <style>
</style> </style>
<div style="text-align: center;">您访问的页面不存在</div> <div style="text-align: center;">您访问的页面不存在</div>
</body> </body>
</html> </html>

View File

@@ -1,14 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
<title>500错误页面</title> <title>500错误页面</title>
<style> <style>
</style> </style>
<div style="text-align: center;">服务器错误</div> <div style="text-align: center;">服务器错误</div>
</body> </body>
</html> </html>

View File

Before

Width:  |  Height:  |  Size: 290 KiB

After

Width:  |  Height:  |  Size: 290 KiB

View File

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

Before

Width:  |  Height:  |  Size: 290 KiB

After

Width:  |  Height:  |  Size: 290 KiB

View File

@@ -1,80 +1,80 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>登录</title> <title>登录</title>
<link rel="stylesheet" type="text/css" href="../lib/mzui/css/mzui.min.css"> <link rel="stylesheet" type="text/css" href="../lib/mzui/css/mzui.min.css">
</head> </head>
<body> <body>
<div id="app"> <div id="app">
<div class="page fade scale-from-center display in" style="overflow: hidden"> <div class="page fade scale-from-center display in" style="overflow: hidden">
<div class="dock blur-lg" style="background: url('../lib/mzui/img/loginBg.jpg') no-repeat center; background-size: cover; top: -2rem; right: -2rem; bottom: -2rem; left: -2rem"></div> <div class="dock blur-lg" style="background: url('../lib/mzui/img/loginBg.jpg') no-repeat center; background-size: cover; top: -2rem; right: -2rem; bottom: -2rem; left: -2rem"></div>
<div class="dock flex flex-center"> <div class="dock flex flex-center">
<div class="modal rounded" style="width: 18rem; height: 10rem; margin: auto;"> <div class="modal rounded" style="width: 18rem; height: 10rem; margin: auto;">
<div class="heading divider primary-pale"> <div class="heading divider primary-pale">
<div class="title">登录 <span class="reason"> 您没有权限访问该内容或需要登录</span></div> <div class="title">登录 <span class="reason"> 您没有权限访问该内容或需要登录</span></div>
</div> </div>
<div class="content box"> <div class="content box">
<div class="control has-label-left"><!-- has-error --> <div class="control has-label-left"><!-- has-error -->
<input type="text" name="username" class="input" v-model="userId" placeholder="用户名"> <input type="text" name="username" class="input" v-model="userId" placeholder="用户名">
<label for="account"><i class="icon-user"></i></label> <label for="account"><i class="icon-user"></i></label>
<div class="help-text" v-if="errorInfo.length > 0">{{errorInfo}}</div> <div class="help-text" v-if="errorInfo.length > 0">{{errorInfo}}</div>
</div> </div>
<div class="control has-label-left"> <div class="control has-label-left">
<input type="password" name="password" v-model="password" class="input" placeholder="密码"> <input type="password" name="password" v-model="password" class="input" placeholder="密码">
<input type="hidden" name="validateCode" value="1234"> <input type="hidden" name="validateCode" value="1234">
<label for="account"><i class="icon-key"></i></label> <label for="account"><i class="icon-key"></i></label>
</div> </div>
<div class="control"> <div class="control">
<button type="submit" v-on:click="loginSubmit" class="btn block primary">登录</button> <button type="submit" v-on:click="loginSubmit" class="btn block primary">登录</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</body> </body>
<script src="../lib/jquery/jquery-3.1.0.min.js"></script> <script src="../lib/jquery/jquery-3.1.0.min.js"></script>
<script src="../lib/mzui/js/mzui.min.js"></script> <script src="../lib/mzui/js/mzui.min.js"></script>
<script src="../lib/vue/vue.js"></script> <script src="../lib/vue/vue.js"></script>
<script src="../lib/mg/js/common.js"></script> <script src="../lib/mg/js/common.js"></script>
<script> <script>
var app = new Vue({ var app = new Vue({
el: '#app', el: '#app',
data: { data: {
userId: "", userId: "",
password: "", password: "",
errorInfo: "" errorInfo: ""
}, },
methods: { methods: {
loginSubmit: function() { loginSubmit: function() {
var param = { var param = {
username: app.userId, username: app.userId,
password: app.password, password: app.password,
validateCode: "1234" validateCode: "1234"
}; };
post(ctx + "login", param, function(result) { post(ctx + "login", param, function(result) {
console.log(result); console.log(result);
if(result.errCode == 200) { if(result.errCode == 200) {
location.href = result.data; location.href = result.data;
} else { } else {
alert("登录失败," + result.errMsg); alert("登录失败," + result.errMsg);
} }
}); });
} }
} }
}); });
</script> </script>
<style> <style>
.reason{color: #f00;font-size: 12px;} .reason{color: #f00;font-size: 12px;}
</style> </style>
</html> </html>