// 判断一个字符串是否是json格式
export const isJson = str => {
  try {
    const jsonObj = JSON.parse(str)
    if ('string' === typeof str && 'object' === typeof jsonObj) return true
  } catch (error) {
    return false
  }
  return false
}