hsun 3 anni fa
parent
commit
cb6d575797
2 ha cambiato i file con 23 aggiunte e 4 eliminazioni
  1. 14 4
      services/share_poster.go
  2. 9 0
      static/htm2img/report_detail.html

+ 14 - 4
services/share_poster.go

@@ -76,11 +76,21 @@ func CreatePosterFromSource(codePage, codeScene, source, version, pars string) (
 		err = errors.New(errMsg)
 		return "", err
 	}
-	// 生成太阳码
-	sunCodeUrl, err := CreateAndUploadSunCode(codePage, codeScene, version)
-	if err != nil {
+	// 获取太阳码,无则生成
+	sunCodeUrl := ""
+	qrcode, err := yb_poster_resource.GetPosterByCondition(path, "qrcode", version)
+	if err != nil && err != utils.ErrNoRow {
 		return
 	}
+	if qrcode != nil && qrcode.ImgURL != "" {
+		sunCodeUrl = qrcode.ImgURL
+	} else {
+		// 生成太阳码
+		sunCodeUrl, err = CreateAndUploadSunCode(codePage, codeScene, version)
+		if err != nil {
+			return
+		}
+	}
 	// 填充html内容
 	contentStr, err := fillContent2Html(source, pars, sunCodeUrl)
 	if err != nil {
@@ -128,7 +138,7 @@ func postHtml2Img(param map[string]interface{}) (resp *Html2ImgResp, err error)
 	if global.CONFIG.Serve.RunMode == "release" {
 
 	} else {
-		pythonUrl = "http://127.0.0.1:8888/"
+		pythonUrl = "http://127.0.0.1:5008/"
 	}
 	postUrl := pythonUrl + "htm2img"
 	postData, err := json.Marshal(param)

+ 9 - 0
static/htm2img/report_detail.html

@@ -53,6 +53,15 @@
             height: 256px;
             float: right;
         }
+        .content-box div{
+            font-size: 36px !important;
+        }
+        .content-box span{
+            font-size: 36px !important;
+        }
+        .content-box p{
+            font-size: 36px !important;
+        }
     </style>
 </head>
 <body>