routeMerchant.js 386 Bytes
/**
 * 安全解析路由 query.params 中的商户行 JSON(与 getRowItem / routerInfo 共用)
 */
export function parseRouteMerchantRow(queryParams) {
  if (queryParams == null || queryParams === "") return {}
  try {
    const o = JSON.parse(queryParams)
    return o &&
      typeof o === "object" &&
      !Array.isArray(o)
      ? o
      : {}
  } catch {
    return {}
  }
}