Commit a5fc35ff authored by GuanHua's avatar GuanHua

fix:获取商品描述模板接口错误时处理

parent 6ecb22a4
......@@ -25,7 +25,7 @@ const Introduction: React.FC<IntroductionPropsType> = (props) => {
}, [commodityTemplateInfo])
const renderIntroduction = () => {
let templateName = commodityTemplateInfo.fileName || 'science'
const templateName = commodityTemplateInfo ? commodityTemplateInfo.fileName || 'science' : 'science'
switch (templateName) {
case 'science':
return <ScienceTemplate {...commodityDetail?.commodityRemark} />
......
......@@ -24,8 +24,11 @@ class SiteStore implements ISiteModule {
this.mallTemplateId = this.mallTemplateInfo.id
return
}
//@ts-ignore
const res = await PublicApi.getTemplatePlatformFindUseTemplateBySite({ siteId: this.siteId })
const param: any = {
siteId: this.siteId
}
const res = await PublicApi.getTemplatePlatformFindUseTemplateBySite(param)
runInAction(() => {
this.mallTemplateInfo = res.data || {}
this.mallTemplateId = this.mallTemplateInfo.id
......@@ -43,11 +46,15 @@ class SiteStore implements ISiteModule {
this.commodityTemplateInfo = JSON.parse(tempCommodityTemplateInfo)
return
}
//@ts-ignore
const res = await PublicApi.getTemplateGoodsFindUseGoodsTemplate({ siteId: this.siteId })
const param: any = {
siteId: this.siteId
}
const res = await PublicApi.getTemplateGoodsFindUseGoodsTemplate(param)
runInAction(() => {
this.commodityTemplateInfo = res.data
sessionStorage.setItem("commodityTemplateInfo", JSON.stringify(this.commodityTemplateInfo))
if(res.code === 1000) {
this.commodityTemplateInfo = res.data
sessionStorage.setItem("commodityTemplateInfo", JSON.stringify(this.commodityTemplateInfo))
}
})
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment