Merge branch 'develop' of https://gitee.com/fusenpack/fusenapi into develop
This commit is contained in:
commit
d20a1b0354
@ -30,7 +30,7 @@ func SetCors(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
rootDir := "../server" // Change this to your root directory
|
rootDir := "../server" // Change this to your root directory
|
||||||
vueBuild := "/home/eson/workspace/fusenpack-vue-created"
|
vueBuild := "/home/ldm/workdir/fusenpack-vue-created"
|
||||||
apiURL, err := url.Parse("http://localhost:9900")
|
apiURL, err := url.Parse("http://localhost:9900")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@ -10,6 +10,7 @@ import (
|
|||||||
"fusenapi/utils/auth"
|
"fusenapi/utils/auth"
|
||||||
"fusenapi/utils/basic"
|
"fusenapi/utils/basic"
|
||||||
"fusenapi/utils/color_list"
|
"fusenapi/utils/color_list"
|
||||||
|
"fusenapi/utils/encryption_decryption"
|
||||||
"fusenapi/utils/format"
|
"fusenapi/utils/format"
|
||||||
"fusenapi/utils/image"
|
"fusenapi/utils/image"
|
||||||
"fusenapi/utils/step_price"
|
"fusenapi/utils/step_price"
|
||||||
@ -380,7 +381,17 @@ func (l *GetProductInfoLogic) GetProductInfo(req *types.GetProductInfoReq, useri
|
|||||||
if req.HaveCloudRendering == true {
|
if req.HaveCloudRendering == true {
|
||||||
renderDesign = l.getRenderDesign(req.ClientNo)
|
renderDesign = l.getRenderDesign(req.ClientNo)
|
||||||
}
|
}
|
||||||
return resp.SetStatusWithMessage(basic.CodeOK, "success", types.GetProductInfoRsp{
|
//查询是否是加密的(不太合理)
|
||||||
|
encryptWebsetting, err := l.svcCtx.AllModels.FsWebSet.FindValueByKey(l.ctx, "is_encrypt")
|
||||||
|
if err != nil {
|
||||||
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "web setting is_encrypt is not exists")
|
||||||
|
}
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get web setting")
|
||||||
|
}
|
||||||
|
//不加密
|
||||||
|
rspData := types.GetProductInfoRsp{
|
||||||
Id: productInfo.Id,
|
Id: productInfo.Id,
|
||||||
Type: *productInfo.Type,
|
Type: *productInfo.Type,
|
||||||
Title: *productInfo.Title,
|
Title: *productInfo.Title,
|
||||||
@ -396,8 +407,17 @@ func (l *GetProductInfoLogic) GetProductInfo(req *types.GetProductInfoReq, useri
|
|||||||
LastDesign: lastDesign,
|
LastDesign: lastDesign,
|
||||||
RenderDesign: renderDesign,
|
RenderDesign: renderDesign,
|
||||||
Colors: color_list.GetColor(),
|
Colors: color_list.GetColor(),
|
||||||
})
|
}
|
||||||
|
if encryptWebsetting.Value == nil || *encryptWebsetting.Value == "0" {
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeOK, "success", rspData)
|
||||||
|
}
|
||||||
|
bytesData, _ := json.Marshal(rspData)
|
||||||
|
enData, err := encryption_decryption.CBCEncrypt(string(bytesData))
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to encryption response data")
|
||||||
|
}
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeOK, "success", enData)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取渲染设计
|
// 获取渲染设计
|
||||||
|
Loading…
x
Reference in New Issue
Block a user