mirror of
https://github.com/lxsang/antd-web-apps
synced 2025-04-22 03:16:45 +02:00
Compare commits
No commits in common. "fd31477739df198366ee9cb80051bd30a82b91a2" and "ce05d671668c9616eadbbdc3e155076a243c3130" have entirely different histories.
fd31477739
...
ce05d67166
@ -132,13 +132,11 @@ function SystemController:apigateway(...)
|
|||||||
r, e = loadfile(ospath)
|
r, e = loadfile(ospath)
|
||||||
if r then
|
if r then
|
||||||
local status, result = pcall(r, data.parameters)
|
local status, result = pcall(r, data.parameters)
|
||||||
if result then
|
|
||||||
if (status) then
|
if (status) then
|
||||||
echo(JSON.encode(result))
|
echo(JSON.encode(result))
|
||||||
else
|
else
|
||||||
echo(result)
|
echo(result)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
else
|
else
|
||||||
echo(e)
|
echo(e)
|
||||||
end
|
end
|
||||||
@ -194,14 +192,7 @@ function SystemController:apigateway(...)
|
|||||||
data = JSON.decodeString(REQUEST.json)
|
data = JSON.decodeString(REQUEST.json)
|
||||||
exec_with_user_priv(data)
|
exec_with_user_priv(data)
|
||||||
elseif args and #args > 0 then
|
elseif args and #args > 0 then
|
||||||
-- data is encoded in url safe base64
|
local decoded = std.b64decode(args[1])
|
||||||
local encoded = args[1]:gsub('_', '/'):gsub('-', '+')
|
|
||||||
if #encoded % 4 == 2 then
|
|
||||||
encoded = encoded.."=="
|
|
||||||
elseif #encoded %4 == 3 then
|
|
||||||
encoded = encoded.."="
|
|
||||||
end
|
|
||||||
local decoded = std.b64decode(encoded)
|
|
||||||
data = JSON.decodeString(bytes.__tostring(decoded))
|
data = JSON.decodeString(bytes.__tostring(decoded))
|
||||||
if data and data.path then
|
if data and data.path then
|
||||||
exec_with_user_priv(data)
|
exec_with_user_priv(data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user