/** JSON 解析,出错时不会抛出错误而是返回 null 对象 */ export function jsonParse(json: string) { try { return JSON.parse(json) } catch (error) { return null } }