hsun 2 years ago
parent
commit
9c8b9fbb0b
1 changed files with 4 additions and 7 deletions
  1. 4 7
      services/share_poster.go

+ 4 - 7
services/share_poster.go

@@ -17,6 +17,8 @@ import (
 	"time"
 )
 
+var ServerUrl = "http://127.0.0.1:5008/"
+
 // SharePosterReq 分享海报请求体
 type SharePosterReq struct {
 	CodePage  string `json:"code_page" description:"太阳码page"`
@@ -128,13 +130,8 @@ type Html2ImgResp struct {
 
 // postHtml2Img 请求htm2img接口
 func postHtml2Img(param map[string]interface{}) (resp *Html2ImgResp, err error) {
-	pythonUrl := ""
-	if global.CONFIG.Serve.RunMode == "release" {
-
-	} else {
-		pythonUrl = "http://127.0.0.1:5008/"
-	}
-	postUrl := pythonUrl + "htm2img"
+	// 目前仅此处调用该接口,暂不加授权、校验等
+	postUrl := ServerUrl + "htm2img"
 	postData, err := json.Marshal(param)
 	if err != nil {
 		return