Commit 95d1b8b0 by 陶光胜

图片base64上传

parent 801fd41f
......@@ -2,6 +2,8 @@ package com.gic.plug.web.controller;
import com.alibaba.fastjson.JSON;
import com.gic.commons.annotation.HeaderSignIgnore;
import com.gic.commons.util.GlobalInfo;
import com.gic.commons.util.GlobalVar;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.ano.IgnoreLogin;
import com.gic.enterprise.error.ErrorCode;
......@@ -142,6 +144,16 @@ public class UploadImgController {
return RestResponse.success(picList);
}
@RequestMapping("/upload-img-str")
@HeaderSignIgnore
@IgnoreLogin
public RestResponse updateImgStr(String imageData){
byte[] image = org.apache.commons.codec.binary.Base64.decodeBase64(imageData.split(",")[1].getBytes());
UploadResult uploadResult = QqCloudPicUtils.uploadLocalPicStream("pic01", "", image);
logger.info("上传图片结果:"+JSON.toJSONString(uploadResult));
return RestResponse.success(uploadResult.getDownloadUrl());
}
public static File multipartFileToFile(MultipartFile file) throws Exception {
File toFile = null;
if ("".equals(file) || file.getSize() <= 0) {
......
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