This commit is contained in:
cdle
2021-09-30 15:14:14 +08:00
parent 1e950e978f
commit 80d1929a15
+5 -3
View File
@@ -82,14 +82,16 @@ func init() {
}
data, err := req.String()
if err != nil {
return nil
return otto.Value{}
}
if strings.Contains(dataType, "json") {
obj, _ := otto.New().Object(fmt.Sprintf(`(%s)`, data))
return obj
}
result, _ := otto.ToValue(data)
result, err := otto.ToValue(data)
if err != nil {
return otto.Value{}
}
return result
}
var handler = func(s Sender) interface{} {