This commit is contained in:
cdle
2023-06-14 15:01:14 +08:00
parent cf310e5ef7
commit da24a7ab97
6 changed files with 282 additions and 0 deletions
+6
View File
@@ -8,6 +8,7 @@ import (
"sync"
"time"
"github.com/cdle/sillyplus/mongodb"
"github.com/cdle/sillyplus/utils"
"github.com/dop251/goja"
"github.com/dop251/goja_nodejs/require"
@@ -438,6 +439,11 @@ func SetPluginMethod(vm *goja.Runtime, uuid string, on_start bool, running func(
vm.Set("os", osjs)
vm.Set("fs", osjs)
vm.Set("forObject", ForeachObject)
vm.Set("MongoClient", func(uri string) interface{} {
return &mongodb.MongoClient{
Uri: uri,
}
})
}
func EncryptPlugin(script string) string {