Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴学德
gdtel-gztel-school-center
Commits
0d46d572
Commit
0d46d572
authored
Mar 13, 2020
by
黄森林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移动端开发提交
parent
e6a09777
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
common/src/main/java/com/winsun/utils/PicturesUtil.java
+4
-4
No files found.
common/src/main/java/com/winsun/utils/PicturesUtil.java
View file @
0d46d572
package
com
.
winsun
.
utils
;
import
com.winsun.constant.FilePath
;
import
lombok.extern.slf4j.Slf4j
;
import
java.io.FileOutputStream
;
...
...
@@ -17,14 +18,14 @@ public class PicturesUtil {
/**
* 上传图片
*
*
<p>
* 前端传来图片必须为jpeg格式
*
* @param file 图片字符串
* @param path 图片文件夹名
* @return
*/
public
static
String
uploadPictures
(
String
file
,
String
path
)
{
public
static
String
uploadPictures
(
String
file
,
String
path
)
{
Date
date
=
new
Date
();
SimpleDateFormat
yyMM
=
new
SimpleDateFormat
(
"yyMM"
);
String
y
=
yyMM
.
format
(
date
.
getTime
());
...
...
@@ -40,8 +41,7 @@ public class PicturesUtil {
* 2.解码成字节数组
*/
// filePath = FilePath.IDCARD.getValue() + y + "/" + h + "/" + path + "/" + date.getTime() + "." + houzhui;
filePath
=
"C:\\Users\\asus\\Desktop\\新建文件夹\\"
+
date
.
getTime
()+
"."
+
houzhui
;
filePath
=
FilePath
.
IDCARD
.
getValue
()
+
y
+
"/"
+
h
+
"/"
+
path
+
"/"
+
date
.
getTime
()
+
"."
+
houzhui
;
Base64
.
Decoder
decoder
=
Base64
.
getDecoder
();
byte
[]
bytes
=
decoder
.
decode
(
base64Data
);
FileOutputStream
fos
=
null
;
...
...
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