This commit is contained in:
cdle
2023-06-12 08:51:54 +08:00
parent 568953503a
commit 725237f71e
5 changed files with 53 additions and 7 deletions
+1 -1
View File
@@ -8,6 +8,6 @@
</head>
<body>
<div id="root"></div>
<script src="/admin/umi.953cac6c.js"></script>
<script src="/admin/umi.c11a7664.js"></script>
</body></html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+6
View File
@@ -426,6 +426,12 @@ func initPlugin(data string, uuid string) (*common.Function, error) {
onStart = strings.TrimSpace(res[2]) == "true"
case "form":
hasForm = true
case "paterner":
paterner := strings.TrimSpace(res[2])
go func() {
time.Sleep(time.Second * 2)
getPaterner(uuid, strings.TrimSpace(paterner))
}()
}
}
script := ""
+40
View File
@@ -0,0 +1,40 @@
package core
func getPaterner(uuid, path string) {
var data []byte
var address = ""
ls := plugin_list
for _, f := range ls {
if f.UUID == uuid {
address = f.Address
break
}
}
if address != "" {
for _, f := range ls {
if f.Address == address && f.Title == path {
data = plugins.GetBytes(f.UUID)
if data != nil {
return
}
}
}
if data == nil {
for _, l := range ls {
if l.Address == address && l.Title == path {
data = fetchScript(l.Address, l.UUID)
if data == nil {
console.Warn("无法从订阅源获取 %s 的协作脚本 %s ", GetScriptNameByUUID(uuid), path)
} else {
console.Log("已从订阅源获取 %s 的协作脚本 %s", GetScriptNameByUUID(uuid), path)
plugins.Set(l.UUID, string(data))
}
return
}
}
}
}
if data == nil {
console.Warn("找不到 %s 的协作脚本 %s", GetScriptNameByUUID(uuid), path)
}
}