|
@@ -5,6 +5,8 @@ import (
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
"github.com/medivhzhan/weapp/v2"
|
|
|
+ "os"
|
|
|
+
|
|
|
//"github.com/pdfcpu/pdfcpu/pkg/api"
|
|
|
//"github.com/pdfcpu/pdfcpu/pkg/pdfcpu"
|
|
|
"hongze/hongze_cygx/models"
|
|
@@ -800,8 +802,19 @@ func (this *ArticleController) Pdfwatermark() {
|
|
|
mobile = user.Email
|
|
|
}
|
|
|
sliceLink := strings.Split(fileLink, "/")
|
|
|
+ uploadDir := "static/pdf/"
|
|
|
+ err = os.MkdirAll(uploadDir, 777)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "存储目录创建失败"
|
|
|
+ br.ErrMsg = "存储目录创建失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
fmt.Println(fileLink)
|
|
|
fmt.Println(sliceLink[len(sliceLink)-1])
|
|
|
+ pdfName := sliceLink[len(sliceLink)-1]
|
|
|
+ _, err = os.Stat(uploadDir + pdfName)
|
|
|
+ fmt.Println(err)
|
|
|
//pdfPath := "static/"
|
|
|
//pdfUrl := fileLink
|
|
|
//fileName := utils.GetRandStringNoSpecialChar(28) + ".pdf"
|