出入库完成
This commit is contained in:
+9
-12
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user