diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 70cf7be9..48bef70c 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -324,13 +324,17 @@ export const evalFn = (fn: string) => { * @param data */ export const JSONParse = (data: string) => { + if (data.trim() === '') return return JSON.parse(data, (k, v) => { - // 过滤函数字符串 - if (excludeParseEventKeyList.includes(k)) return v - // 过滤函数值表达式 - if (typeof v === 'string') { - const someValue = excludeParseEventValueList.some(excludeValue => v.indexOf(excludeValue) > -1) - if (someValue) return v + // // 过滤函数字符串 + // if (excludeParseEventKeyList.includes(k)) return v + // // 过滤函数值表达式 + // if (typeof v === 'string') { + // const someValue = excludeParseEventValueList.some(excludeValue => v.indexOf(excludeValue) > -1) + // if (someValue) return v + // } + if (k !== 'formatter') { + return v } // 还原函数值 if (typeof v === 'string' && v.indexOf && (v.indexOf('function') > -1 || v.indexOf('=>') > -1)) {