This commit is contained in:
cdle
2021-10-29 09:36:06 +08:00
parent ff3ee34079
commit 019baed9a8
+5 -3
View File
@@ -5,7 +5,6 @@ import (
"fmt"
"io"
"io/ioutil"
"log"
"os"
"regexp"
"strings"
@@ -22,7 +21,6 @@ type JsReply string
var o = NewBucket("otto")
func init() {
go func() {
time.Sleep(time.Second)
{
@@ -45,7 +43,11 @@ var OttoFuncs = map[string]func(string) string{
// }
id, err := machineid.ProtectedID("sillyGirl")
if err != nil {
log.Fatal(err)
id = sillyGirl.Get("machineId")
if id == "" {
id = GetUUID()
sillyGirl.Set("machineId", id)
}
}
return id
},