diff --git a/core/init.go b/core/init.go index 127ef2a..5684233 100644 --- a/core/init.go +++ b/core/init.go @@ -47,4 +47,7 @@ func init() { api_key := time.Now().UnixNano() sillyGirl.Set("api_key", api_key) } + if sillyGirl.Get("uuid") == "" { + sillyGirl.Set("uuid", GetUUID()) + } } diff --git a/core/test.go b/core/test.go index 1dfbe8b..a596ee2 100644 --- a/core/test.go +++ b/core/test.go @@ -394,6 +394,13 @@ Alias=sillyGirl.service` return nil }, }, + { + Rules: []string{"^机器码$"}, + Admin: true, + Handle: func(s Sender) interface{} { + return OttoFuncs["machineId"]("") + }, + }, }) }