Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop

This commit is contained in:
momo 2023-08-21 19:01:53 +08:00
commit 1dd0c78868
3 changed files with 37 additions and 7 deletions

View File

@ -1,6 +1,7 @@
package main
import (
"crypto/tls"
"fmt"
"io"
"io/ioutil"
@ -41,6 +42,8 @@ func SetCors(w http.ResponseWriter, r *http.Request) {
var pathdict sync.Map = sync.Map{}
func main() {
log.SetFlags(log.Llongfile)
// 将静态资源路径存储到pathdict
pathdict.Store("/css", true)
pathdict.Store("/fonts", true)
@ -114,7 +117,34 @@ func main() {
ServerAddress := ":9900"
log.Println("listen on ", ServerAddress)
log.Fatal(http.ListenAndServe(ServerAddress, mux))
keydata, err := os.ReadFile("/opt/server.fusen.3718.cn.key")
if err != nil {
panic(err)
}
pemdata, err := os.ReadFile("/opt/server.fusen.3718.cn.pem")
if err != nil {
panic(err)
}
cert, err := tls.X509KeyPair(pemdata, keydata)
if err != nil {
panic(err)
}
tlscfg := &tls.Config{
Certificates: []tls.Certificate{cert},
MinVersion: tls.VersionTLS12,
MaxVersion: tls.VersionTLS13,
}
serv := http.Server{
Addr: ServerAddress,
Handler: mux,
TLSConfig: tlscfg,
}
log.Fatal(serv.ListenAndServeTLS("", ""))
}
// 后端服务的类型

View File

@ -118,18 +118,18 @@ func (l *GetTemplateByPidLogic) GetTemplateByPid(req *types.GetTemplateByPidReq,
"material_data": map[string]interface{}{
"QRcode": map[string]interface{}{
"if_show": true,
"text": "二维码",
"default_value": "默认二维码",
"text": "1111",
"default_value": "11111",
},
"Website": map[string]interface{}{
"if_show": true,
"text": "网站",
"default_value": "默认网站",
"text": "2222",
"default_value": "2222",
},
"Address": map[string]interface{}{
"if_show": true,
"text": "address",
"default_value": "非洲",
"default_value": "address",
},
"Phone": map[string]interface{}{
"if_show": true,

View File

@ -198,7 +198,7 @@ func (w *wsConnectItem) assembleRenderData(taskId string, info websocket_data.Re
}
res, err := w.logic.svcCtx.Repositories.ImageHandle.LogoCombine(w.logic.ctx, &combineReq)
if err != nil {
logx.Error("合成刀版图失败:", err)
logx.Error("合成刀版图失败,合成请求数据:", combineReq, "错误信息:", err)
return err
}
combineImage := "" //刀版图