/** * URL参数解析工具 * 用于获取和合并URL查询参数与默认值 */ /** * 获取默认参数(开发环境使用) * @returns {Object} 默认参数对象 */ export const getDefaultParams = () => { return { caseId: '202602261114241000', caseTypeFirst: '24_01-2', caseType: '24_02-9', platform_code: 'AI_0001', authorization: '' }; }; /** * 解析URL查询参数 * @returns {Object} URL参数对象 */ export const parseUrlParams = () => { const params = {}; const searchParams = new URLSearchParams(window.location.search); // 获取所有参数 for (const [key, value] of searchParams.entries()) { params[key] = value; } return params; }; /** * 合并URL参数和默认值 * URL参数优先级高于默认值 * @returns {Object} 合并后的参数对象 */ export const getMergedParams = () => { // const defaultParams = getDefaultParams(); const urlParams = parseUrlParams(); return { // ...defaultParams, ...urlParams }; };