出入库完成

This commit is contained in:
hoteas
2021-12-15 05:56:31 +08:00
parent 9482404265
commit ac66331535
7 changed files with 413 additions and 18 deletions
+9 -12
View File
@@ -50,27 +50,24 @@ func main() {
return false
}
filePath := context.Config.GetString("filePath")
if filePath == "" {
filePath = "file/2006/01/02/"
}
path := time.Now().Format(filePath)
os.MkdirAll(context.Config.GetString("tpt")+"/"+path, os.ModeDir)
fi, _ := base64.StdEncoding.DecodeString(ocr)
filePath = path + common.Md5(common.ObjToStr(common.RandX(100000, 9999999))) + ".jpg"
go func() {
filePath := context.Config.GetString("filePath")
if filePath == "" {
filePath = "file/2006/01/02/"
}
path := time.Now().Format(filePath)
e := os.MkdirAll(context.Config.GetString("tpt")+"/"+path, os.ModeDir)
if e != nil {
return
}
fi, _ := base64.StdEncoding.DecodeString(ocr)
filePath = path + common.Md5(common.ObjToStr(common.RandX(100000, 9999999))) + ".jpg"
ioutil.WriteFile(context.Config.GetString("tpt")+"/"+filePath, fi, 0666)
}()
re := tencent.OCR(ocr)
re1 := tencent.Qrcode(ocr)
data := common.Map{}
data := common.Map{"url": filePath}
//fmt.Println(re1)
data["text"] = common.ObjToMap(re)