mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
nodejs: using method getServerUrl
This commit is contained in:
@ -412,7 +412,7 @@ app.get("/editor", function (req, res) {
|
||||
if (fileExt != null) {
|
||||
var fileName = docManager.createDemo((req.query.sample ? "sample." : "new.") + fileExt, userid, name);
|
||||
|
||||
var redirectPath = docManager.getProtocol() + "://" + docManager.req.get("host") + "/editor?fileName=" + encodeURIComponent(fileName) + docManager.getCustomParams();
|
||||
var redirectPath = docManager.getServerUrl() + "/editor?fileName=" + encodeURIComponent(fileName) + docManager.getCustomParams();
|
||||
res.redirect(redirectPath);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@ docManager.getFileUri = function (fileName) {
|
||||
};
|
||||
|
||||
docManager.getlocalFileUri = function (fileName, version) {
|
||||
var serverPath = docManager.getProtocol() + "://" + docManager.req.get("host");
|
||||
var serverPath = docManager.getServerUrl();
|
||||
var storagePath = storageFolder.length ? storageFolder + "/" : "";
|
||||
var hostAddress = docManager.curUserHostAddress();
|
||||
var url = serverPath + "/" + storagePath + hostAddress + "/" + encodeURIComponent(fileName);
|
||||
@ -167,7 +167,7 @@ docManager.getServerUrl = function () {
|
||||
};
|
||||
|
||||
docManager.getCallback = function (fileName) {
|
||||
var server = docManager.getProtocol() + "://" + docManager.req.get("host");
|
||||
var server = docManager.getServerUrl();
|
||||
var hostAddress = docManager.curUserHostAddress();
|
||||
var handler = "/track?useraddress=" + encodeURIComponent(hostAddress) + "&filename=" + encodeURIComponent(fileName);
|
||||
|
||||
|
||||
@ -138,7 +138,7 @@
|
||||
comments: true,
|
||||
feedback: true,
|
||||
goback: {
|
||||
url: ("<%= editor.type %>" == "embedded" ? null : "<%= editor.getServerUrl %>")
|
||||
url: "<%= editor.getServerUrl %>"
|
||||
}
|
||||
},
|
||||
fileChoiceUrl: "<%= editor.fileChoiceUrl %>",
|
||||
|
||||
Reference in New Issue
Block a user