master
wangbing 6 years ago
parent 447b3a2450
commit e916a547e2

@ -9,7 +9,7 @@
<relativePath/> <relativePath/>
</parent> </parent>
<groupId>xyz.wbsite</groupId> <groupId>xyz.wbsite</groupId>
<artifactId>FILEMGR-WEB</artifactId> <artifactId>fmgr</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<!--<packaging>war</packaging>--><!--需要打包成war时放开--> <!--<packaging>war</packaging>--><!--需要打包成war时放开-->

@ -1,27 +1,25 @@
package xyz.wbsite.framework.freemarker; package xyz.wbsite.framework.freemarker;
import xyz.wbsite.framework.utils.LogUtil;
import org.springframework.beans.factory.annotation.Autowire;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.servlet.DispatcherServlet; import org.springframework.web.servlet.DispatcherServlet;
import org.springframework.web.servlet.LocaleResolver; import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.View; import org.springframework.web.servlet.View;
import org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator; import org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator;
import org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver; import org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver;
import xyz.wbsite.framework.utils.LocalData;
import xyz.wbsite.framework.utils.LogUtil;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
/** /**
* FreemarkerViewName * FreemarkerViewName
* *
@ -63,7 +61,7 @@ public class ViewNameTranslator extends DefaultRequestToViewNameTranslator {
} }
Locale locale = localeResolver.resolveLocale(request); Locale locale = localeResolver.resolveLocale(request);
{//查询View {//查询screen
String[] split = servletPath.split("/"); String[] split = servletPath.split("/");
StringBuilder sb = new StringBuilder(""); StringBuilder sb = new StringBuilder("");
sb.append("screen"); sb.append("screen");
@ -75,7 +73,9 @@ public class ViewNameTranslator extends DefaultRequestToViewNameTranslator {
View view = viewResolver.resolveViewName(viewName, locale); View view = viewResolver.resolveViewName(viewName, locale);
if (view == null) { if (view == null) {
LogUtil.e("can not find screen."); LogUtil.e("can not find screen.");
return "404"; HttpServletResponse response = LocalData.getResponse();
response.setStatus(HttpStatus.NOT_FOUND.value());
return "";
} }
} }

@ -14,7 +14,7 @@ web.welcome.page = index
# 需要验证授权 # 需要验证授权
web.url.auth.included = /** web.url.auth.included = /**
# 不需要验证授权 # 不需要验证授权
web.url.auth.excluded = /static/**,/open/**,/api,/index,/,/login,/up web.url.auth.excluded = /favicon.ico,/static/**,/open/**,/api,/index,/,/login,/up
# 默认的登录URL # 默认的登录URL
web.url.login = /login web.url.login = /login
# 日志配置 # 日志配置

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

@ -101,35 +101,5 @@ window.ajax = {
return fileRequest({ return fileRequest({
data: fd data: fd
}) })
}, }
newTableCreate: function (data) {
return jsonRequest({
method:"ajax.filemgr.new.table.create",
data: JSON.stringify(data),
})
},
newTableDelete: function (data) {
return jsonRequest({
method:"ajax.filemgr.new.table.delete",
data: JSON.stringify(data),
})
},
newTableUpdate: function (data) {
return jsonRequest({
method:"ajax.filemgr.new.table.update",
data: JSON.stringify(data),
})
},
newTableFind: function (data) {
return jsonRequest({
method:"ajax.filemgr.new.table.find",
data: JSON.stringify(data),
})
},
newTableGet: function(data) {
return jsonRequest({
method:"ajax.filemgr.new.table.get",
data: JSON.stringify(data),
})
},
} }

@ -3,9 +3,12 @@
<head> <head>
<title></title> <title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link href="${Uri.getUrl('/static/img/favicon.ico')}" rel="Shortcut Icon" type="image/x-icon"/> <#--baseJs-->
<script src="${Uri.getUrl('/static/dist/lib.min.js')}" type="text/javascript"></script> <script src="${Uri.getUrl('/static/dist/lib.min.js')}" type="text/javascript"></script>
<link href="${Uri.getUrl('/static/dist/lib.min.css')}" rel="stylesheet"/> <#--element-ui-->
<script src="${Uri.getUrl('/static/dist/index.min.js')}" type="text/javascript"></script>
<link href="${Uri.getUrl('/static/dist/index.min.css')}" rel="stylesheet"/>
<#--ajax接口-->
<script src="${Uri.getUrl('/static/js/ajax.js')}" type="text/javascript"></script> <script src="${Uri.getUrl('/static/js/ajax.js')}" type="text/javascript"></script>
<link href="${Uri.getUrl('/static/css/base.css')}" rel="stylesheet"/> <link href="${Uri.getUrl('/static/css/base.css')}" rel="stylesheet"/>
</head> </head>

@ -4,9 +4,17 @@
<title>文件管理</title> <title>文件管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
<link href="${Uri.getUrl('/static/img/favicon.ico')}" rel="Shortcut Icon" type="image/x-icon"/> <#--baseJs-->
<script src="${Uri.getUrl('/static/dist/lib.min.js')}" type="text/javascript"></script> <script src="${Uri.getUrl('/static/dist/lib.min.js')}" type="text/javascript"></script>
<#--element-ui-->
<script src="${Uri.getUrl('/static/dist/index.min.js')}" type="text/javascript"></script>
<link href="${Uri.getUrl('/static/dist/index.min.css')}" rel="stylesheet"/>
<#--ajax接口-->
<script src="${Uri.getUrl('/static/js/ajax.js')}" type="text/javascript"></script>
<link href="${Uri.getUrl('/static/css/base.css')}" rel="stylesheet"/>
</head> </head>
<body> <body>
<#include Layout.setControl("macro")/>
<#include Layout.setControl("nav")/>
<#include Layout.setScreen()/> <#include Layout.setScreen()/>
</html> </html>

@ -3,8 +3,6 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>Mint UI</title>
</head> </head>
<body> <body>
<div id="app"> <div id="app">

@ -22,76 +22,31 @@
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div> <div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload> </el-upload>
<div class="body"> <#--<div class="body">-->
<form action="upload" method="post" enctype="multipart/form-data"> <#--<form action="upload" method="post" enctype="multipart/form-data">-->
<a class="icon" onclick="file.click()"> <#--<a class="icon" onclick="file.click()">-->
<img src="${Uri.getUrl('/static/img/add.png')}"> <#--<img src="${Uri.getUrl('/static/img/add.png')}">-->
</a> <#--</a>-->
<input id="file" name="file" type="file"> <#--<input id="file" name="file" type="file">-->
<input class="submit" type="submit" value="提交"> <#--<input class="submit" type="submit" value="提交">-->
</form> <#--</form>-->
</div> <#--</div>-->
</div> </div>
</div> </div>
</div> </div>
<style> <style>
#app {
margin: 0px auto;
display: flex;
justify-content: center;
height: 100%;
}
* { * {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
} }
#app {
}
.main { .main {
padding: 5px; padding: 5px;
} }
.content {
background-color: #ececd2;
box-shadow: 0px 0px 5px 0px;
}
.content .head {
height: 27px;
line-height: 27px;
padding-left: 10px;
background-color: #67B2FF;
color: white;
font-weight: bolder;
}
.content .body {
padding: 10px;
text-align: center;
}
.content .body .icon {
display: block;
text-align: center;
}
.content .body .icon img {
width: 50px;
height: 50px;
}
.content .body .submit {
display: inline-block;
width: 100%;
height: 30px;
margin-top: 10px;
background-color: #ffffff;
border: 1px solid #D6D6D6;
color: #6F7173;
font-weight: bolder;
}
</style> </style>
<script type="text/javascript"> <script type="text/javascript">
@ -99,13 +54,13 @@
var app = new Vue({ var app = new Vue({
el: '#app', el: '#app',
data: { data: {
transitionName: '' transitionName: '',
},
methods: {
fileList: [{ fileList: [{
name: 'food.jpeg', name: 'food.jpeg',
url: 'static/img/logo.png' url: 'static/img/logo.png'
}], }],
},
methods: {
handleUpload: function (req) { handleUpload: function (req) {
ajax.fileUpload(req.file).then(function (response) { ajax.fileUpload(req.file).then(function (response) {
if (response.errors.length > 0) { if (response.errors.length > 0) {
@ -129,7 +84,7 @@
}, },
handleExceed: function (files, fileList) { handleExceed: function (files, fileList) {
this.$message.warning('当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件用户头像上传'); this.$message.warning('当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件用户头像上传');
}, }
}, },
created: function () { created: function () {
}, },

Loading…
Cancel
Save

Powered by TurnKey Linux.