Commit 5398c400 by qwmqiuwenmin

fix

parent 5e62dcaf
......@@ -123,7 +123,9 @@ public class MaterialApiServiceImpl implements MaterialApiService {
if(fileType != null){
JSONResponse jp = qywxSuiteApiService.uploadMedia(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(url), fileType.getCode());
if(jp.getErrorCode() == 0){
materialDTO.setMediaId(jp.getResult().toString());
String json = jp.getResult().toString();
JSONObject jsonObject = JSON.parseObject(json);
materialDTO.setMediaId(jsonObject.getString("media_id"));
materialService.insertMaterial(materialDTO);
}
}else{
......@@ -210,7 +212,9 @@ public class MaterialApiServiceImpl implements MaterialApiService {
}
JSONResponse jp = qywxSuiteApiService.uploadMedia(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(url), fileType.getCode());
if(jp.getErrorCode() == 0){
old.setMediaId(jp.getResult().toString());
String json = jp.getResult().toString();
JSONObject jsonObject = JSON.parseObject(json);
old.setMediaId(jsonObject.getString("media_id"));
materialService.edit(old);
}
return old.getMediaId();
......
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