Let backend generate dockey in Onlyoffice

This commit is contained in:
Xuan Sang LE
2021-03-05 18:18:55 +01:00
parent f04340e174
commit d39d10d78a
10 changed files with 29 additions and 14 deletions

View File

@ -22,8 +22,14 @@ end
local handle = {}
handle.token = function()
return result("sessionid="..SESSION.sessionid)
handle.token = function(data)
local file = vfs.ospath(data.file)
local stat = ulib.file_stat(file)
local ret = {
sid = "sessionid="..SESSION.sessionid,
key = std.sha1(file..":"..stat.mtime)
}
return result(ret)
end
handle.duplicate = function(data)