Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
D
data-server
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
licc
data-server
Commits
818c1654
Commit
818c1654
authored
Mar 16, 2021
by
m1991
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录模块——用户注册验证码 - 注册成功后 -验证码删除功能修复
parent
716729c3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
UploadServiceImpl.java
...java/cn/wisenergy/service/app/impl/UploadServiceImpl.java
+8
-4
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UploadServiceImpl.java
View file @
818c1654
...
@@ -62,7 +62,7 @@ public class UploadServiceImpl implements UploadService {
...
@@ -62,7 +62,7 @@ public class UploadServiceImpl implements UploadService {
* + ":" + request.getServerPort()+/upload/";"
* + ":" + request.getServerPort()+/upload/";"
*/
*/
String
basePath
=
"/upload/"
;
String
basePath
=
"/upload/"
;
Long
time
=
new
Date
().
getTime
();
Long
time
=
System
.
currentTimeMillis
();
String
fileName
=
file
.
getOriginalFilename
();
//文件原始名称
String
fileName
=
file
.
getOriginalFilename
();
//文件原始名称
String
suffixName
=
fileName
.
substring
(
fileName
.
lastIndexOf
(
"."
));
//从最后一个.开始截取。截取fileName的后缀名
String
suffixName
=
fileName
.
substring
(
fileName
.
lastIndexOf
(
"."
));
//从最后一个.开始截取。截取fileName的后缀名
...
@@ -92,7 +92,8 @@ public class UploadServiceImpl implements UploadService {
...
@@ -92,7 +92,8 @@ public class UploadServiceImpl implements UploadService {
resultMap
.
put
(
"videoUrl"
,
videoUrl
);
resultMap
.
put
(
"videoUrl"
,
videoUrl
);
resultMap
.
put
(
"imgUrl"
,
imgUrl
);
resultMap
.
put
(
"imgUrl"
,
imgUrl
);
resultMap
.
put
(
"returnCode"
,
0
);
resultMap
.
put
(
"code"
,
0
);
resultMap
.
put
(
"msg"
,
"视频上传成功"
);
String
zxUrl
=
videoUrl
;
String
zxUrl
=
videoUrl
;
//System.out.println("上传的文件名为:"+fileName+",后缀名为:"+newFileName);
//System.out.println("上传的文件名为:"+fileName+",后缀名为:"+newFileName);
/**
/**
...
@@ -115,8 +116,6 @@ public class UploadServiceImpl implements UploadService {
...
@@ -115,8 +116,6 @@ public class UploadServiceImpl implements UploadService {
*/
*/
Long
zxDate
=
System
.
currentTimeMillis
();
Long
zxDate
=
System
.
currentTimeMillis
();
// request.getScheme() + "://" + request.getServerName()
// + ":" + request.getServerPort()+"/upload/";
String
basePath
=
"/upload/"
;
String
basePath
=
"/upload/"
;
...
@@ -175,6 +174,11 @@ public class UploadServiceImpl implements UploadService {
...
@@ -175,6 +174,11 @@ public class UploadServiceImpl implements UploadService {
for
(
MultipartFile
file
:
files
)
{
for
(
MultipartFile
file
:
files
)
{
if
(
file
.
isEmpty
())
{
if
(
file
.
isEmpty
())
{
System
.
out
.
println
(
"上传图片为空,请重新上传"
);
System
.
out
.
println
(
"上传图片为空,请重新上传"
);
Map
map
=
new
HashMap
();
map
.
put
(
"code"
,
0
);
map
.
put
(
"msg"
,
"上传视频为空,请重新上传"
);
return
map
;
}
}
//判断上传文件格式
//判断上传文件格式
String
fileType
=
file
.
getContentType
();
String
fileType
=
file
.
getContentType
();
...
...
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