提交fileUpload

This commit is contained in:
weiweiw 2024-09-29 09:36:12 +08:00
parent 96d23b943e
commit 105dcd7232
1 changed files with 4 additions and 3 deletions

View File

@ -121,9 +121,10 @@ public class FaceServiceImpl implements FaceService {
}
private AjaxResult handleFileUpload(MultipartFile file, FaceVo face) throws Exception {
R<SysFile> upload = remoteFileService.upload(file);
if (upload.getCode() == 200) {
face.setFaceAddress(upload.getData().getUrl().replaceFirst("http://[^/]+", ""));
AjaxResult upload = remoteFileService.upload(file);
if (upload.isSuccess()) {
String url = upload.getDataAs(SysFile.class).getUrl();
face.setFaceAddress(url.replaceFirst("http://[^/]+", ""));
return faceMapper.insertFace(face) > 0 ? AjaxResult.success() : AjaxResult.error();
}
return AjaxResult.error();