diff --git a/public/res/year-statistic/index.html b/public/res/year-statistic/index.html index 00ab8718..97e678ac 100644 --- a/public/res/year-statistic/index.html +++ b/public/res/year-statistic/index.html @@ -954,7 +954,13 @@ // 获取URL参数 function getProviderIdFromUrl() { const urlParams = new URLSearchParams(window.location.search); - return urlParams.get('providerId') || null; + // return urlParams.get('providerId') || null; + let providerId = urlParams.get('providerId'); + // 处理URL格式错误的情况(如 ?providerId=33041?token=xxx,第二个?应该是&) + if (providerId && providerId.includes('?')) { + providerId = providerId.split('?')[0]; + } + return providerId || null; } // 读取JSON文件