mirror of https://gitee.com/y_project/RuoYi.git
修复文件上传多级目录识别问题
parent
6ad6f90968
commit
db9d1a7720
|
@ -29,7 +29,7 @@
|
|||
|
||||
$.extend($.fn.bootstrapTable.locales, {
|
||||
formatExport: function () {
|
||||
return 'Export data';
|
||||
return '导出';
|
||||
}
|
||||
});
|
||||
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
|
||||
|
|
|
@ -146,7 +146,7 @@ public class FileUploadUtils
|
|||
|
||||
private static final String getPathFileName(String uploadDir, String fileName) throws IOException
|
||||
{
|
||||
int dirLastIndex = uploadDir.lastIndexOf("/") + 1;
|
||||
int dirLastIndex = Global.getProfile().length() + 1;
|
||||
String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
|
||||
String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
|
||||
return pathFileName;
|
||||
|
|
|
@ -46,9 +46,8 @@ public class GenController extends BaseController
|
|||
|
||||
@RequiresPermissions("tool:gen:view")
|
||||
@GetMapping()
|
||||
public String gen(ModelMap mmap)
|
||||
public String gen()
|
||||
{
|
||||
mmap.put("genTables", genTableService.selectGenTableList(new GenTable()));
|
||||
return prefix + "/gen";
|
||||
}
|
||||
|
||||
|
@ -98,9 +97,8 @@ public class GenController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("tool:gen:list")
|
||||
@GetMapping("/importTable")
|
||||
public String importTable(ModelMap mmap)
|
||||
public String importTable()
|
||||
{
|
||||
mmap.put("dbTables", genTableService.selectDbTableList(new GenTable()));
|
||||
return prefix + "/importTable";
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('代码生成列表')" />
|
||||
<th:block th:include="include :: select2-css" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
|
@ -12,16 +11,10 @@
|
|||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
表名称:<select name="tableName" class="form-control">
|
||||
<option value="">所有</option>
|
||||
<option th:each="table : ${genTables}" th:text="${table.tableName}" th:value="${table.tableName}"></option>
|
||||
</select>
|
||||
表名称:<input type="text" name="tableName"/>
|
||||
</li>
|
||||
<li>
|
||||
表描述:<select name="tableComment" class="form-control">
|
||||
<option value="">所有</option>
|
||||
<option th:each="table : ${genTables}" th:text="${table.tableComment}" th:value="${table.tableComment}"></option>
|
||||
</select>
|
||||
表描述:<input type="text" name="tableComment"/>
|
||||
</li>
|
||||
<li class="select-time">
|
||||
<label>表时间: </label>
|
||||
|
@ -31,7 +24,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -59,7 +52,6 @@
|
|||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: select2-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "tool/gen";
|
||||
var editFlag = [[${@permission.hasPermi('tool:gen:edit')}]];
|
||||
|
@ -186,12 +178,6 @@
|
|||
var importTableUrl = prefix + "/importTable";
|
||||
$.modal.open("导入表结构", importTableUrl);
|
||||
}
|
||||
|
||||
function resetPre() {
|
||||
$.form.reset();
|
||||
$("select[name='tableName']").val(null).trigger("change");
|
||||
$("select[name='tableComment']").val(null).trigger("change");
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -2,7 +2,6 @@
|
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('导入表结构')" />
|
||||
<th:block th:include="include :: select2-css" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
|
@ -12,20 +11,14 @@
|
|||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
表名称:<select name="tableName" class="form-control">
|
||||
<option value="">所有</option>
|
||||
<option th:each="table : ${dbTables}" th:text="${table.tableName}" th:value="${table.tableName}"></option>
|
||||
</select>
|
||||
表名称:<input type="text" name="tableName"/>
|
||||
</li>
|
||||
<li>
|
||||
表描述:<select name="tableComment" class="form-control">
|
||||
<option value="">所有</option>
|
||||
<option th:each="table : ${dbTables}" th:text="${table.tableComment}" th:value="${table.tableComment}"></option>
|
||||
</select>
|
||||
表描述:<input type="text" name="tableComment"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -38,7 +31,6 @@
|
|||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: select2-js" />
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "tool/gen";
|
||||
|
||||
|
@ -99,12 +91,6 @@
|
|||
var data = {"tables": rows.join()};
|
||||
$.operate.save(prefix + "/importTable", data);
|
||||
}
|
||||
|
||||
function resetPre() {
|
||||
$.form.reset();
|
||||
$("select[name='tableName']").val(null).trigger("change");
|
||||
$("select[name='tableComment']").val(null).trigger("change");
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue