Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liqin
chnmuseum-party
Commits
22d65a7d
Commit
22d65a7d
authored
May 14, 2021
by
jiawei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG修改====》》修改文件上传的格式类型,与提示消息
parent
15548a2a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
FileUploadController.java
.../chnmuseum/party/web/controller/FileUploadController.java
+5
-3
No files found.
src/main/java/cn/chnmuseum/party/web/controller/FileUploadController.java
View file @
22d65a7d
...
@@ -57,7 +57,7 @@ public class FileUploadController extends BaseController {
...
@@ -57,7 +57,7 @@ public class FileUploadController extends BaseController {
private
static
final
String
[]
AUDIO_TYPE
=
new
String
[]{
"MP3"
,
"AAC"
,
"WMA"
,
"FLAC"
,
"RM"
,
"OGG"
};
private
static
final
String
[]
AUDIO_TYPE
=
new
String
[]{
"MP3"
,
"AAC"
,
"WMA"
,
"FLAC"
,
"RM"
,
"OGG"
};
// private static final String[] VIDEO_TYPE = new String[]{"MP4", "FLV", "MPEG", "MPG", "MOV"};
// private static final String[] VIDEO_TYPE = new String[]{"MP4", "FLV", "MPEG", "MPG", "MOV"};
//按照王亭亭提的BUG要求 修改视频界面的提示信息改为只支持MP4、flv、mov
//按照王亭亭提的BUG要求 修改视频界面的提示信息改为只支持MP4、flv、mov
private
static
final
String
[]
VIDEO_TYPE
=
new
String
[]{
"MP4"
,
"FLV"
,
"MOV"
};
private
static
final
String
[]
VIDEO_TYPE
=
new
String
[]{
"MP4"
,
"FLV"
,
"OGG"
,
"WEBM"
,
"MOV"
};
private
static
final
String
[]
DOC_TYPE
=
new
String
[]{
"PDF"
,
"DOC"
,
"DOCX"
,
"PPT"
,
"PPTX"
};
private
static
final
String
[]
DOC_TYPE
=
new
String
[]{
"PDF"
,
"DOC"
,
"DOCX"
,
"PPT"
,
"PPTX"
};
private
static
final
char
[]
SPLITTER_CHAR_2
=
new
char
[]{
'@'
,
'#'
};
private
static
final
char
[]
SPLITTER_CHAR_2
=
new
char
[]{
'@'
,
'#'
};
private
static
final
char
[]
SPLITTER_CHAR_3
=
new
char
[]{
'@'
,
'#'
,
'$'
};
private
static
final
char
[]
SPLITTER_CHAR_3
=
new
char
[]{
'@'
,
'#'
,
'$'
};
...
@@ -440,7 +440,8 @@ public class FileUploadController extends BaseController {
...
@@ -440,7 +440,8 @@ public class FileUploadController extends BaseController {
String
extName
=
FilenameUtils
.
getExtension
(
files
[
0
].
getOriginalFilename
());
String
extName
=
FilenameUtils
.
getExtension
(
files
[
0
].
getOriginalFilename
());
boolean
anyMatch
=
Arrays
.
stream
(
VIDEO_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
extName
.
toUpperCase
()));
boolean
anyMatch
=
Arrays
.
stream
(
VIDEO_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
extName
.
toUpperCase
()));
if
(!
anyMatch
)
{
if
(!
anyMatch
)
{
return
getFailResult
(
"目前仅支持"
+
String
.
join
(
"、"
,
VIDEO_TYPE
)
+
"格式"
);
// return getFailResult("目前仅支持" + String.join("、", VIDEO_TYPE) + "格式");
return
getFailResult
(
"支持h264编码的MP4视频、VP8编码的webm视频和Theora编码的ogg视频"
);
}
}
}
}
String
videoContentName
=
null
;
String
videoContentName
=
null
;
...
@@ -625,7 +626,8 @@ public class FileUploadController extends BaseController {
...
@@ -625,7 +626,8 @@ public class FileUploadController extends BaseController {
String
extName
=
FilenameUtils
.
getExtension
(
files
[
0
].
getOriginalFilename
());
String
extName
=
FilenameUtils
.
getExtension
(
files
[
0
].
getOriginalFilename
());
boolean
anyMatch
=
Arrays
.
stream
(
VIDEO_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
extName
.
toUpperCase
()));
boolean
anyMatch
=
Arrays
.
stream
(
VIDEO_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
extName
.
toUpperCase
()));
if
(!
anyMatch
)
{
if
(!
anyMatch
)
{
return
getFailResult
(
"目前仅支持"
+
String
.
join
(
"、"
,
VIDEO_TYPE
)
+
"格式"
);
// return getFailResult("目前仅支持" + String.join("、", VIDEO_TYPE) + "格式");
return
getFailResult
(
"支持h264编码的MP4视频、VP8编码的webm视频和Theora编码的ogg视频"
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
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