调整onlyoffice配置
This commit is contained in:
parent
347d0d5d4a
commit
76247d9461
@ -14,13 +14,22 @@ import org.springframework.stereotype.Component;
|
||||
@ConfigurationProperties(prefix = "only-office")
|
||||
public class OnlyOfficeProperties {
|
||||
|
||||
private String server;
|
||||
private String serverUrl;
|
||||
private String callbackUrl;
|
||||
|
||||
public String getServer() {
|
||||
return server == null ? "" : server.trim();
|
||||
public String getServerUrl() {
|
||||
return serverUrl == null ? "" : serverUrl.trim();
|
||||
}
|
||||
|
||||
public void setServer(String server) {
|
||||
this.server = server;
|
||||
public void setServerUrl(String serverUrl) {
|
||||
this.serverUrl = serverUrl;
|
||||
}
|
||||
|
||||
public String getCallbackUrl() {
|
||||
return callbackUrl == null ? "" : callbackUrl.trim();
|
||||
}
|
||||
|
||||
public void setCallbackUrl(String callbackUrl) {
|
||||
this.callbackUrl = callbackUrl;
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ public class OnlyOfficeRouteController {
|
||||
@PathVariable("fileId") String fileId) {
|
||||
ModelAndView modelAndView = new ModelAndView("only-office/edit");
|
||||
modelAndView.addObject("fileId", fileId);
|
||||
modelAndView.addObject("server", onlyOfficeProperties.getServer());
|
||||
modelAndView.addObject("server", onlyOfficeProperties.getServerUrl());
|
||||
modelAndView.addObject("config", onlyOfficeService.getConfig(formCode, formVersion, uid, fileId));
|
||||
return modelAndView;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ import ink.wgink.module.form.pojo.vos.onlyoffice.OnlyOfficeSaveVO;
|
||||
import ink.wgink.module.form.service.onlyoffice.IOnlyOfficeService;
|
||||
import ink.wgink.pojo.bos.UserInfoBO;
|
||||
import ink.wgink.pojo.pos.FilePO;
|
||||
import ink.wgink.properties.ServerProperties;
|
||||
import ink.wgink.properties.onlyoffice.OnlyOfficeProperties;
|
||||
import ink.wgink.util.UUIDUtil;
|
||||
import ink.wgink.util.string.WStringUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -47,7 +47,7 @@ public class OnlyOfficeServiceImpl extends DefaultBaseService implements IOnlyOf
|
||||
"fodp", "odp", "otp", "pot", "potm", "potx", "pps", "ppsm", "ppsx", "ppt", "pptm", "pptx"};
|
||||
|
||||
@Autowired
|
||||
private ServerProperties serverProperties;
|
||||
private OnlyOfficeProperties onlyOfficeProperties;
|
||||
@Autowired
|
||||
private IFileService fileV2Service;
|
||||
|
||||
@ -94,7 +94,7 @@ public class OnlyOfficeServiceImpl extends DefaultBaseService implements IOnlyOf
|
||||
documentDTO.setFileType(filePO.getFileType());
|
||||
documentDTO.setTitle(filePO.getFileName());
|
||||
documentDTO.setKey(WStringUtil.randomSubStr(UUIDUtil.get32UUID(), 20));
|
||||
documentDTO.setUrl(serverProperties.getUrl() + "/route/file/download/false/" + fileId);
|
||||
documentDTO.setUrl(onlyOfficeProperties.getCallbackUrl() + "/route/file/download/false/" + fileId);
|
||||
// 权限
|
||||
PermissionsDTO permissionsDTO = new PermissionsDTO();
|
||||
permissionsDTO.setChat(false);
|
||||
@ -114,7 +114,7 @@ public class OnlyOfficeServiceImpl extends DefaultBaseService implements IOnlyOf
|
||||
// 编辑配置
|
||||
EditConfigDTO editConfigDTO = new EditConfigDTO();
|
||||
editConfigDTO.setCallbackUrl(String.format("%s/app/only-office/save-release/code/%s/version/%d/uid/%s/file-id/%s",
|
||||
serverProperties.getUrl(),
|
||||
onlyOfficeProperties.getCallbackUrl(),
|
||||
formCode,
|
||||
formVersion,
|
||||
uid,
|
||||
|
Loading…
Reference in New Issue
Block a user