fix: 🐛 修改在买家端商品详情中因为categoryName为空导致页面出错不展示bug

master
Yer 2023-06-16 10:58:06 +08:00
parent 48f2bd82a1
commit 26a539662e
1 changed files with 2 additions and 1 deletions

View File

@ -118,6 +118,7 @@ export default {
.then((res) => { .then((res) => {
this.isLoading = false; this.isLoading = false;
if (res.success) { if (res.success) {
const result = res.result; const result = res.result;
const cateName = res.result.categoryName; const cateName = res.result.categoryName;
const cateId = result.data.categoryPath.split(","); const cateId = result.data.categoryPath.split(",");
@ -126,7 +127,7 @@ export default {
// idname // idname
cateArr.push({ cateArr.push({
id: e, id: e,
name: cateName[index], name: cateName ? cateName[index] : "",
}); });
}); });
this.categoryBar = cateArr; this.categoryBar = cateArr;