Browse Source

no message

Jianghan 1 year ago
parent
commit
1176c7da89
2 changed files with 4 additions and 3 deletions
  1. 1 1
      api/internal/logic/sendmaillogic.go
  2. 3 2
      service/exprot.go

+ 1 - 1
api/internal/logic/sendmaillogic.go

@@ -33,5 +33,5 @@ func (l *SendMailLogic) SendMail(req *types.ExportByDbReq) (resp *types.BiResp,
 		Query:   req.Query,
 		Stype:   req.Stype,
 	})
-	return &types.BiResp{Error_code: res.ErrorCode, Error_msg: res.ErrorMsg, Data: res.Data}, err
+	return &types.BiResp{Error_code: res.ErrorCode, Error_msg: res.ErrorMsg, Data: string(res.Data)}, err
 }

+ 3 - 2
service/exprot.go

@@ -260,10 +260,11 @@ func (e *ExportByDbReq) ExportDataByDb() []byte {
 	if stype == "" {
 		stype = "public"
 	}
-	folderPath := fmt.Sprintf("%s/%s/%s", ComFileDir, stype, timeStr)
+	folderPath := fmt.Sprintf("%s/%s", ComFileDir, stype)
 	pathArr := exportA(e.Query, folderPath, timeStr, key)
 	if len(pathArr) > 0 {
-		pathstr := compressFiles(pathArr, folderPath, folderPath, timeStr)
+		folderPath = fmt.Sprintf("%s/%s", folderPath, timeStr)
+		pathstr := compressFiles(pathArr, ComFileUrl, folderPath, timeStr)
 		state := sendMailA(e.Title, e.Mails, e.Content, pathstr)
 
 		BiService.Insert("export_record", map[string]interface{}{