Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Springboot Plus
Commits
163be433
Commit
163be433
authored
Mar 14, 2018
by
李家智
Browse files
中文文件名下载
parent
d1704029
Changes
4
Show whitespace changes
Inline
Side-by-side
admin-core/src/main/java/com/ibeetl/admin/core/web/FileSystemContorller.java
View file @
163be433
...
...
@@ -74,7 +74,7 @@ public class FileSystemContorller {
String
path
=
id
;
response
.
setContentType
(
"text/html; charset = UTF-8"
);
FileItem
fileItem
=
fileService
.
loadFileItemByPath
(
path
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
fileItem
.
getName
());
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
java
.
net
.
URLEncoder
.
encode
(
fileItem
.
getName
()
,
"UTF-8"
)
);
fileItem
.
copy
(
response
.
getOutputStream
());
if
(
fileItem
.
isTemp
())
{
fileItem
.
delete
();
...
...
@@ -91,7 +91,7 @@ public class FileSystemContorller {
start1
=
start2
;
}
String
file
=
path
.
substring
(
start1
+
1
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
file
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
java
.
net
.
URLEncoder
.
encode
(
file
,
"UTF-8"
)
);
InputStream
input
=
Thread
.
currentThread
().
getContextClassLoader
().
getResourceAsStream
(
"excelTemplates/"
+
path
);
FileUtil
.
copy
(
input
,
response
.
getOutputStream
());
return
null
;
...
...
admin-core/src/main/resources/static/js/lib.js
View file @
163be433
...
...
@@ -231,6 +231,7 @@ var Lib = {
},
download
:
function
(
fileId
){
fileId
=
encodeURIComponent
(
fileId
);
window
.
location
.
href
=
Common
.
ctxPath
+
"
/core/file/get.do?id=
"
+
fileId
},
...
...
admin-core/src/main/resources/templates/common/layout.html
View file @
163be433
...
...
@@ -45,9 +45,11 @@
</script>
<style>
.site-block
{
padding
:
20px
;
border
:
1px
solid
#eee
;}
input
{
background-color
:
expression
((
this
.
readOnly
&&
this
.
readOnly
==
true
)
?
"#efefef"
:
""
);}
input
[
readonly
]
{
.input-readonly
{
background-color
:
#efefef
;
cursor
:
not-allowed
;
}
</style>
</head>
...
...
admin-core/src/main/resources/templates/common/tag/simpleDictSelect.tag.html
View file @
163be433
...
...
@@ -18,9 +18,9 @@ if(has(readonly)){
}
}
-->
<input
type=
"text"
class=
"layui-input
"
readonly
value=
"${selectedDict.name}"
></input>
<input
type=
"text"
class=
"layui-input
input-
readonly
"
value=
"${selectedDict.name}"
></input>
<input
type=
"hidden"
name=
"${name}"
class=
"layui-input"
value=
"${expected}"
></input>
value=
"${expected}"
></input>
<!--#}else{ -->
<select
data-group=
"${group!}"
name=
"${name}"
${
has
(
id
)?("
id=
"+id):''}>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment