From 3efb68c477ec14c8b0909b50ca713b752fed2b7b Mon Sep 17 00:00:00 2001 From: liaozetao <1107136310@qq.com> Date: Thu, 18 Apr 2024 17:37:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=9D=E9=A2=98=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/world/WorldAdminView.vue | 54 +++++++++++++++++------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/src/views/world/WorldAdminView.vue b/src/views/world/WorldAdminView.vue index 61caf4c..b2bb5f6 100644 --- a/src/views/world/WorldAdminView.vue +++ b/src/views/world/WorldAdminView.vue @@ -409,34 +409,40 @@ export default { request.success({ "rows": res.rows.map(i=>{ let name = i.name; - if (name.startsWith('{') && name.endsWith('}')) { - i.name = JSON.parse(i.name); - } else { - i.name = { - zh: i.name, - ar: i.name, - en: i.name, - }; + if (name) { + if (name.startsWith('{') && name.endsWith('}')) { + i.name = JSON.parse(i.name); + } else { + i.name = { + zh: i.name, + ar: i.name, + en: i.name, + }; + } } let description = i.description; - if (description.startsWith('{') && description.endsWith('}')) { - i.description = JSON.parse(i.description); - } else { - i.description = { - zh: i.description, - ar: i.description, - en: i.description, - }; + if (description) { + if (description.startsWith('{') && description.endsWith('}')) { + i.description = JSON.parse(i.description); + } else { + i.description = { + zh: i.description, + ar: i.description, + en: i.description, + }; + } } let notice = i.notice; - if (notice.startsWith('{') && notice.endsWith('}')) { - i.notice = JSON.parse(i.notice); - } else { - i.notice = { - zh: i.notice, - ar: i.notice, - en: i.notice, - }; + if (notice) { + if (notice.startsWith('{') && notice.endsWith('}')) { + i.notice = JSON.parse(i.notice); + } else { + i.notice = { + zh: i.notice, + ar: i.notice, + en: i.notice, + }; + } } return i; }),