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)