fix: 供应商邮件为空时报错

2.0/email-builder
Jimmy Liow 10 months ago
parent d748a91c5d
commit 4d72b6c0a0

@ -119,13 +119,10 @@ export const useOrderStore = create(devtools((set, get) => ({
fetchOtherEmail: (coli_sn) => {
return fetchJSON(`${EMAIL_HOST}/email_supplier`, { coli_sn })
.then(json => {
if (json.errcode === 0 && json.result?.MailInfo.length > 0) {
console.info(json.result)
if (json.errcode === 0) {
set(() => ({
otherEmailList: json.result.MailInfo,
otherEmailList: json.result.MailInfo ?? [],
}))
return json.result?.MailInfo
} else {
throw new Error(json?.errmsg + ': ' + json.errcode)
}

@ -60,7 +60,7 @@ const CustomerProfile = () => {
.finally(() => setLoading(false))
.catch(reason => {
notification.error({
message: "查询出错",
message: "查询供应商邮件出错",
description: reason.message,
placement: "top",
duration: 60,

Loading…
Cancel
Save