Commit 0044d2cc by 罗承锋

调整图片路径

parent d3eb14c6
......@@ -20,7 +20,7 @@ import java.util.Date;
public class PicturesUtil {
/**
* 上传路径
* 服务器上传路径
*/
private static String UPLOAD_PRE = "/springboot/school_center/manager/";
......@@ -63,10 +63,6 @@ public class PicturesUtil {
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(" ","+"));
FileOutputStream fos = null;
try {
......@@ -91,7 +87,7 @@ public class PicturesUtil {
}
String enclosure = "";
if (filePath != null) {
enclosure = filePath.replace("enclosure", "manager/ciop");
enclosure = filePath.replace(UPLOAD_PRE + "enclosure", "manager/ciop");
}
return enclosure;
......@@ -118,7 +114,7 @@ public class PicturesUtil {
* @return
*/
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;
//判断文件是否存在
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