Commit 0044d2cc by 罗承锋

调整图片路径

parent d3eb14c6
...@@ -20,7 +20,7 @@ import java.util.Date; ...@@ -20,7 +20,7 @@ import java.util.Date;
public class PicturesUtil { public class PicturesUtil {
/** /**
* 上传路径 * 服务器上传路径
*/ */
private static String UPLOAD_PRE = "/springboot/school_center/manager/"; private static String UPLOAD_PRE = "/springboot/school_center/manager/";
...@@ -63,10 +63,6 @@ public class PicturesUtil { ...@@ -63,10 +63,6 @@ public class PicturesUtil {
filePath = UPLOAD_PRE + FilePath.PATH.getValue()+ pathType+ "/" + yymmdd + "/" + orderNum + "/" + (new Date()).getTime() + "." + PicturesUtil.checkSuffix(houzhui); filePath = UPLOAD_PRE + FilePath.PATH.getValue()+ pathType+ "/" + yymmdd + "/" + orderNum + "/" + (new Date()).getTime() + "." + PicturesUtil.checkSuffix(houzhui);
//byte[] bytes = Base64.getUrlDecoder().decode(base64Data);
//byte[] bytes =new BASE64Decoder().decodeBuffer(base64Data);
//byte[] bytes = Base64.getDecoder().decode(base64Data);
byte[] bytes = Base64.getMimeDecoder().decode(base64Data.replace(" ","+")); byte[] bytes = Base64.getMimeDecoder().decode(base64Data.replace(" ","+"));
FileOutputStream fos = null; FileOutputStream fos = null;
try { try {
...@@ -91,7 +87,7 @@ public class PicturesUtil { ...@@ -91,7 +87,7 @@ public class PicturesUtil {
} }
String enclosure = ""; String enclosure = "";
if (filePath != null) { if (filePath != null) {
enclosure = filePath.replace("enclosure", "manager/ciop"); enclosure = filePath.replace(UPLOAD_PRE + "enclosure", "manager/ciop");
} }
return enclosure; return enclosure;
...@@ -118,7 +114,7 @@ public class PicturesUtil { ...@@ -118,7 +114,7 @@ public class PicturesUtil {
* @return * @return
*/ */
public static boolean deletePictures(String fileName){ public static boolean deletePictures(String fileName){
File file = new File(fileName.replace("manager/ciop","enclosure")); File file = new File(fileName.replace("manager/ciop",UPLOAD_PRE + "enclosure"));
Boolean flag = false; Boolean flag = false;
//判断文件是否存在 //判断文件是否存在
if (file.exists() == true){ if (file.exists() == true){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment