|
@@ -887,7 +887,7 @@ func (this *ArticleController) Pdfwatermark() {
|
|
|
br.ErrMsg = "下载失败,下载过于频繁:mobile" + user.Mobile
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ resp := new(models.ArticleDetailFileLink)
|
|
|
detail := new(models.ArticleDetail)
|
|
|
detail, err = models.GetArticleDetailById(articleId)
|
|
|
if err != nil {
|
|
@@ -955,11 +955,16 @@ func (this *ArticleController) Pdfwatermark() {
|
|
|
}
|
|
|
err = api.AddWatermarksFile(oldFile, newFile, nil, wm, nil)
|
|
|
if err != nil {
|
|
|
- br.Msg = "下载失败"
|
|
|
- br.ErrMsg = "生成水印PDF失败,Err:" + err.Error()
|
|
|
+ //br.Msg = "下载失败"
|
|
|
+ //br.ErrMsg = "生成水印PDF失败,Err:" + err.Error()
|
|
|
+ resp.FileLink = fileLink
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
return
|
|
|
}
|
|
|
- resp := new(models.ArticleDetailFileLink)
|
|
|
+
|
|
|
randStr := utils.GetRandStringNoSpecialChar(28)
|
|
|
fileName := randStr + ".pdf"
|
|
|
savePath := uploadDir + time.Now().Format("200601/20060102/")
|