parent
808dc18885
commit
cd06fce8a0
@ -0,0 +1,84 @@
|
||||
package ${basePackage}.frame.auth;
|
||||
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* LocalData - 本地数据存放类
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class LocalData {
|
||||
|
||||
private static Token temp = null;
|
||||
|
||||
private static Token system = null;
|
||||
|
||||
static {
|
||||
// 组装临时Token和系统Token
|
||||
temp = new Token();
|
||||
temp.setId(-1);
|
||||
temp.setUserId(-1);
|
||||
temp.setUserName("游客");
|
||||
temp.putResource("ajax.system.admin.login");
|
||||
system = new Token();
|
||||
system.setId(0);
|
||||
system.setUserId(0);
|
||||
system.setUserName("system");
|
||||
system.putResource(".*");
|
||||
}
|
||||
|
||||
public static Token getTempToken() {
|
||||
return temp;
|
||||
}
|
||||
|
||||
public static Token getSysToken() {
|
||||
return system;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当请求目标 target = '/aa/bb'
|
||||
*/
|
||||
private static final ThreadLocal<String> targetHolder = new ThreadLocal();
|
||||
|
||||
public static String getTarget() {
|
||||
return targetHolder.get();
|
||||
}
|
||||
|
||||
public static void setTarget(String target) {
|
||||
targetHolder.set(target);
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前用户的通行证
|
||||
*/
|
||||
private static final ThreadLocal<Token> tokenHolder = new ThreadLocal();
|
||||
|
||||
public static Token getToken() {
|
||||
return tokenHolder.get();
|
||||
}
|
||||
|
||||
public static void setToken(Token token) {
|
||||
tokenHolder.set(token);
|
||||
}
|
||||
|
||||
public static HttpServletRequest getRequest() {
|
||||
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
}
|
||||
|
||||
public static HttpServletResponse getResponse() {
|
||||
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
|
||||
}
|
||||
|
||||
public static ApplicationContext getApplicationContext() {
|
||||
return WebApplicationContextUtils.getWebApplicationContext(getRequest().getServletContext());
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package ${basePackage}.frame.auth;
|
||||
|
||||
import ${basePackage}.frame.validation.DictValidator;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Constraint(validatedBy = DictValidator.class)
|
||||
public @interface Verification {
|
||||
String name() default "";
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,40 +1,80 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
html,body{
|
||||
overflow: hidden;
|
||||
}
|
||||
.box{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: scroll;
|
||||
}
|
||||
.box a{
|
||||
color: #c38168;
|
||||
line-height: 18px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.box::-webkit-scrollbar {/*滚动条整体样式*/
|
||||
width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
|
||||
height: 1px;
|
||||
}
|
||||
.box::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
|
||||
border-radius: 10px;
|
||||
-webkit-box-shadow: inset 0 0 5px rgba(73, 73, 73, 0.2);
|
||||
background: #828282;
|
||||
}
|
||||
.box::-webkit-scrollbar-track {/*滚动条里面轨道*/
|
||||
-webkit-box-shadow: inset 0 0 5px rgba(125, 125, 125, 0.2);
|
||||
border-radius: 10px;
|
||||
background: #EDEDED;
|
||||
<meta charset="UTF-8" http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
|
||||
<title>500-服务器走了下神!</title>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
background-color: #dfdfdf;
|
||||
}
|
||||
|
||||
.box {
|
||||
border: 10px solid #0000002b;
|
||||
margin: 100px auto;
|
||||
padding: 50px;
|
||||
width: 700px;
|
||||
background-color: #ffffff;
|
||||
display: table;
|
||||
}
|
||||
|
||||
.box > div {
|
||||
vertical-align: top;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.box > div.img {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.box > div.info {
|
||||
width: 500px;
|
||||
padding-left: 50px;
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.box > div.info {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.box > div.info a {
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
background: #f2f2f2;
|
||||
cursor: pointer;
|
||||
border: 3px solid #0000002b;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.box > div.info a:hover {
|
||||
background: #e6e6e6;
|
||||
border: 3px solid #0000002b
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<body>
|
||||
<div class="box">
|
||||
<p>
|
||||
${msg}
|
||||
</p>
|
||||
</div>
|
||||
<div class="img">
|
||||
<svg t="1571233328721" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="4252" width="198" height="198">
|
||||
<path d="M969.143 548.571q0 14.848-10.862 25.71t-25.71 10.862h-128q0 97.719-38.29 165.705L885.138 870.29Q896 881.152 896 896t-10.862 25.71q-10.276 10.861-25.71 10.861t-25.71-10.861L720.568 809.143q-2.853 2.852-8.558 7.424t-23.99 16.274-37.157 20.846-46.848 16.567-55.443 7.424v-512H475.43v512q-29.148 0-58.003-7.717t-49.7-18.87-37.705-22.273-24.869-18.578l-8.558-8.01-104.557 118.273q-11.447 11.995-27.429 11.995-13.714 0-24.576-9.143-10.862-10.276-11.703-25.417t8.85-26.587L252.6 741.632q-33.134-65.134-33.134-156.562h-128q-14.848 0-25.71-10.862t-10.861-25.71 10.861-25.71 25.71-10.861h128v-168.01l-98.852-98.852q-10.862-10.862-10.862-25.71t10.862-25.71 25.71-10.861 25.709 10.862l98.853 98.852h482.304l98.852-98.852q10.862-10.862 25.71-10.862t25.71 10.862 10.861 25.71-10.861 25.71l-98.853 98.852v168.009h128q14.848 0 25.71 10.862t10.861 25.71zM694.857 219.43H329.143q0-75.996 53.43-129.427T512 36.572t129.426 53.43 53.431 129.427z"
|
||||
fill="" p-id="4253"></path>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
<p style="font-size: 18px;font-weight: bold">服务器内部错误,错误信息如下:</p>
|
||||
|
||||
<p>${msg}</p>
|
||||
|
||||
</body>
|
||||
<br>
|
||||
|
||||
<a onclick="history.back()">返回上页</a> <a href="/">返回首页</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,40 +1,80 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
html,body{
|
||||
overflow: hidden;
|
||||
}
|
||||
.box{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: scroll;
|
||||
}
|
||||
.box a{
|
||||
color: #c38168;
|
||||
line-height: 18px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.box::-webkit-scrollbar {/*滚动条整体样式*/
|
||||
width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
|
||||
height: 1px;
|
||||
}
|
||||
.box::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
|
||||
border-radius: 10px;
|
||||
-webkit-box-shadow: inset 0 0 5px rgba(73, 73, 73, 0.2);
|
||||
background: #828282;
|
||||
}
|
||||
.box::-webkit-scrollbar-track {/*滚动条里面轨道*/
|
||||
-webkit-box-shadow: inset 0 0 5px rgba(125, 125, 125, 0.2);
|
||||
border-radius: 10px;
|
||||
background: #EDEDED;
|
||||
<meta charset="UTF-8" http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
|
||||
<title>500-服务器走了下神!</title>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
background-color: #dfdfdf;
|
||||
}
|
||||
|
||||
.box {
|
||||
border: 10px solid #0000002b;
|
||||
margin: 100px auto;
|
||||
padding: 50px;
|
||||
width: 700px;
|
||||
background-color: #ffffff;
|
||||
display: table;
|
||||
}
|
||||
|
||||
.box > div {
|
||||
vertical-align: top;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.box > div.img {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.box > div.info {
|
||||
width: 500px;
|
||||
padding-left: 50px;
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.box > div.info {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.box > div.info a {
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
background: #f2f2f2;
|
||||
cursor: pointer;
|
||||
border: 3px solid #0000002b;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.box > div.info a:hover {
|
||||
background: #e6e6e6;
|
||||
border: 3px solid #0000002b
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<body>
|
||||
<div class="box">
|
||||
<p>
|
||||
${msg}
|
||||
</p>
|
||||
</div>
|
||||
<div class="img">
|
||||
<svg t="1571233328721" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="4252" width="198" height="198">
|
||||
<path d="M969.143 548.571q0 14.848-10.862 25.71t-25.71 10.862h-128q0 97.719-38.29 165.705L885.138 870.29Q896 881.152 896 896t-10.862 25.71q-10.276 10.861-25.71 10.861t-25.71-10.861L720.568 809.143q-2.853 2.852-8.558 7.424t-23.99 16.274-37.157 20.846-46.848 16.567-55.443 7.424v-512H475.43v512q-29.148 0-58.003-7.717t-49.7-18.87-37.705-22.273-24.869-18.578l-8.558-8.01-104.557 118.273q-11.447 11.995-27.429 11.995-13.714 0-24.576-9.143-10.862-10.276-11.703-25.417t8.85-26.587L252.6 741.632q-33.134-65.134-33.134-156.562h-128q-14.848 0-25.71-10.862t-10.861-25.71 10.861-25.71 25.71-10.861h128v-168.01l-98.852-98.852q-10.862-10.862-10.862-25.71t10.862-25.71 25.71-10.861 25.709 10.862l98.853 98.852h482.304l98.852-98.852q10.862-10.862 25.71-10.862t25.71 10.862 10.861 25.71-10.861 25.71l-98.853 98.852v168.009h128q14.848 0 25.71 10.862t10.861 25.71zM694.857 219.43H329.143q0-75.996 53.43-129.427T512 36.572t129.426 53.43 53.431 129.427z"
|
||||
fill="" p-id="4253"></path>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
<p style="font-size: 18px;font-weight: bold">服务器内部错误,错误信息如下:</p>
|
||||
|
||||
<p>${msg}</p>
|
||||
|
||||
</body>
|
||||
<br>
|
||||
|
||||
<a onclick="history.back()">返回上页</a> <a href="/">返回首页</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in new issue