fix: kyc return relative directory
This commit is contained in:
@@ -33,12 +33,12 @@ public class SysFileController {
|
||||
// 上传并返回访问地址
|
||||
FileUploadResult urlResult = sysFileService.uploadFile(file);
|
||||
SysFile sysFile = new SysFile();
|
||||
sysFile.setName(FileUtils.getName(urlResult.getUri()));
|
||||
sysFile.setName(FileUtils.getName(urlResult.getUrl()));
|
||||
sysFile.setName(FileUtils.getName(urlResult.getLocalUrl()));
|
||||
sysFile.setName(FileUtils.getName(urlResult.getGatewayUrl()));
|
||||
sysFile.setUri(urlResult.getUri());
|
||||
sysFile.setUrl(urlResult.getUrl());
|
||||
sysFile.setLocalUrl(urlResult.getLocalUrl());
|
||||
sysFile.setUrl(urlResult.getGatewayUrl());
|
||||
sysFile.setGatewayUrl(urlResult.getGatewayUrl());
|
||||
return R.ok(sysFile);
|
||||
} catch (Exception e) {
|
||||
log.error("上传文件失败", e);
|
||||
|
||||
@@ -49,25 +49,25 @@ public class LocalSysFileServiceImpl implements ISysFileService
|
||||
@Override
|
||||
public FileUploadResult uploadFile(MultipartFile file) throws Exception {
|
||||
String name = FileUploadUtils.upload(localFilePath, file);
|
||||
String uri = localFilePrefix + name;
|
||||
String url = localFilePrefix + name;
|
||||
String localUrl = domain + localFilePrefix + name;
|
||||
String gatewayUrl = gateway + pathPrefix + localFilePrefix + name;
|
||||
return new FileUploadResult(uri, localUrl, gatewayUrl);
|
||||
return new FileUploadResult(url, localUrl, gatewayUrl);
|
||||
}
|
||||
|
||||
public static class FileUploadResult {
|
||||
private final String uri;
|
||||
private final String url;
|
||||
private final String localUrl;
|
||||
private final String gatewayUrl;
|
||||
|
||||
public FileUploadResult(String uri, String localUrl, String gatewayUrl) {
|
||||
this.uri = uri;
|
||||
public FileUploadResult(String url, String localUrl, String gatewayUrl) {
|
||||
this.url = url;
|
||||
this.localUrl = localUrl;
|
||||
this.gatewayUrl = gatewayUrl;
|
||||
}
|
||||
|
||||
public String getUri() {
|
||||
return uri;
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public String getLocalUrl() {
|
||||
|
||||
Reference in New Issue
Block a user