This commit is contained in:
cdle
2023-07-04 10:58:33 +08:00
parent 437a31a6b8
commit 873bccce55
8 changed files with 64 additions and 26 deletions
+4 -1
View File
@@ -49,7 +49,10 @@ func fetch(vm *goja.Runtime, wts ...interface{}) (interface{}, error) {
if f, ok := props[i].(func(i goja.FunctionCall) goja.Value); ok {
url = f(goja.FunctionCall{}).ToString().String()
} else {
url = props[i].(string)
if props[i] == nil {
panic(Error(vm, "无效的url请求地址nil"))
}
url = fmt.Sprint(props[i])
}
case "json":
if props[i].(bool) {