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,12 +132,10 @@ function SystemController:apigateway(...)
|
||||
r, e = loadfile(ospath)
|
||||
if r then
|
||||
local status, result = pcall(r, data.parameters)
|
||||
if result then
|
||||
if (status) then
|
||||
echo(JSON.encode(result))
|
||||
else
|
||||
echo(result)
|
||||
end
|
||||
if (status) then
|
||||
echo(JSON.encode(result))
|
||||
else
|
||||
echo(result)
|
||||
end
|
||||
else
|
||||
echo(e)
|
||||
@ -194,14 +192,7 @@ function SystemController:apigateway(...)
|
||||
data = JSON.decodeString(REQUEST.json)
|
||||
exec_with_user_priv(data)
|
||||
elseif args and #args > 0 then
|
||||
-- data is encoded in url safe base64
|
||||
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)
|
||||
local decoded = std.b64decode(args[1])
|
||||
data = JSON.decodeString(bytes.__tostring(decoded))
|
||||
if data and data.path then
|
||||
exec_with_user_priv(data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user