perf: logic

main
ZGGSONG 2 years ago
parent 67add2b5f4
commit 86b2fc9f7d

@ -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()

@ -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)

Loading…
Cancel
Save