From e9bedb0960dbfd3332cab1638759a3c4b50e695f Mon Sep 17 00:00:00 2001 From: weiwei Date: Tue, 11 Mar 2025 11:15:40 +0800 Subject: [PATCH] ` --- src/views/wallet/mch-manage/form.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/views/wallet/mch-manage/form.vue b/src/views/wallet/mch-manage/form.vue index 79e6e26..ed5f5ca 100644 --- a/src/views/wallet/mch-manage/form.vue +++ b/src/views/wallet/mch-manage/form.vue @@ -197,13 +197,14 @@ const getmerchantInfoData = async (id: string) => { try { const res = await getObj(id) if (res.code === 0) { - const resJobTime = res.data.jobTime ? res.data.jobTime.split(",") : [] + const regex = /^.*?,.*?,.*?$/ + const resJobTime = res.data.jobTime && regex.test(res.data.jobTime) ? res.data.jobTime.split(",") : [] Object.assign(form, res.data, { merchantType: res.data.types, }) - jobTime.morning = resJobTime[0]?.split("-") - jobTime.noon = resJobTime[1]?.split("-") - jobTime.evening = resJobTime[2]?.split("-") + jobTime.morning = resJobTime[0]?.split("-") ?? [] + jobTime.noon = resJobTime[1]?.split("-") ?? [] + jobTime.evening = resJobTime[2]?.split("-") ?? [] } } catch (error: any) { useMessage().error(error.msg)