diff --git a/main.go b/main.go index a561700..9808485 100644 --- a/main.go +++ b/main.go @@ -26,7 +26,7 @@ func init() { log.SetFormatter(&log.TextFormatter{ TimestampFormat: "2006-01-02 15:04:05", }) - + log.Printf("[INFO] ======") // 初始化配置文件 global.GLO_CONFIG = config.InitialConfig() diff --git a/serve/serve.go b/serve/serve.go index 780b9db..8c2e533 100644 --- a/serve/serve.go +++ b/serve/serve.go @@ -2,6 +2,7 @@ package serve import ( "bytes" + "encoding/base64" "fmt" log "github.com/sirupsen/logrus" "image" @@ -10,6 +11,7 @@ import ( _ "image/jpeg" _ "image/png" "io" + "io/ioutil" "net/http" "os" "receive-files/global" @@ -85,6 +87,16 @@ https://github.com/zggsong`)) // func DeclarationService(files []string) { time.Sleep(3 * time.Second) + //登陆获取auth + + //申报 + for _, file := range files { + srcByte, _ := ioutil.ReadFile(file) + res := base64.StdEncoding.EncodeToString(srcByte) + log.Printf("[DEBUG] Base64 decoding: %s", res) + } + //刷新门禁 + for _, file := range files { if err := os.Remove(file); err != nil { log.Printf("[ERROR] 删除失败, %v", err)