|
@@ -14,6 +14,7 @@ import (
|
|
|
"encoding/base64"
|
|
|
"encoding/json"
|
|
|
"github.com/shopspring/decimal"
|
|
|
+ gojs "gorunjs/client"
|
|
|
"io/ioutil"
|
|
|
mu "mfw/util"
|
|
|
"net/http"
|
|
@@ -906,6 +907,14 @@ func (s *Script) LoadScript(site, channel, user *string, code, script_file strin
|
|
|
S.Push(lua.LString(respCookie))
|
|
|
return 3
|
|
|
}))
|
|
|
+ s.L.SetGlobal("goRunJs", s.L.NewFunction(func(S *lua.LState) int {
|
|
|
+ param := S.ToString(-2) //list or detail
|
|
|
+ step := S.ToString(-1) //参数
|
|
|
+ result := gojs.GoRunJsGetResult(s.SCode, param, step)
|
|
|
+ qu.Debug("Go Run Js Result:", param, step, result)
|
|
|
+ S.Push(lua.LString(result))
|
|
|
+ return 1
|
|
|
+ }))
|
|
|
s.L.SetGlobal("newDownloadFile", s.L.NewFunction(func(S *lua.LState) int {
|
|
|
cookie := S.ToString(-1)
|
|
|
head := S.ToTable(-2)
|