master
wangbing 6 years ago
parent 447b3a2450
commit e916a547e2

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

@ -1,27 +1,25 @@
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.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
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.LocaleResolver;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator;
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.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.Locale;
import java.util.Map;
/**
* FreemarkerViewName
*
@ -63,7 +61,7 @@ public class ViewNameTranslator extends DefaultRequestToViewNameTranslator {
}
Locale locale = localeResolver.resolveLocale(request);
{//查询View
{//查询screen
String[] split = servletPath.split("/");
StringBuilder sb = new StringBuilder("");
sb.append("screen");
@ -75,7 +73,9 @@ public class ViewNameTranslator extends DefaultRequestToViewNameTranslator {
View view = viewResolver.resolveViewName(viewName, locale);
if (view == null) {
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.excluded = /static/**,/open/**,/api,/index,/,/login,/up
web.url.auth.excluded = /favicon.ico,/static/**,/open/**,/api,/index,/,/login,/up
# 默认的登录URL
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({
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>
<title></title>
<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>
<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>
<link href="${Uri.getUrl('/static/css/base.css')}" rel="stylesheet"/>
</head>

@ -4,9 +4,17 @@
<title>文件管理</title>
<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">
<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>
<#--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>
<body>
<#include Layout.setControl("macro")/>
<#include Layout.setControl("nav")/>
<#include Layout.setScreen()/>
</html>

@ -3,8 +3,6 @@
<head>
<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">
<title>Mint UI</title>
</head>
<body>
<div id="app">

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

Loading…
Cancel
Save

Powered by TurnKey Linux.