优化资产订阅页面,新增用户类型选择功能,支持在开通服务时选择租户模块类型,同时优化开通成功后的跳转逻辑,增加5秒内防重复触发402状态码的保护机制,避免开通完成后立即跳转又触发未开通提示的循环问题

This commit is contained in:
WUSIJIAN
2026-01-21 16:27:54 +08:00
parent af17d81422
commit b9795c2cc4
2 changed files with 190 additions and 21 deletions

View File

@@ -210,6 +210,15 @@ const responseErrorHandler = (error: any) => {
case 402:
// 模块未开通处理跳过SKU相关接口避免循环
if (!requestUrl.includes('/assets/asset/sku/') && !requestUrl.includes('getAssetAndSku')) {
// 检查是否刚从开通页面返回5秒内不再跳转
const lastSubscribeTime = sessionStorage.getItem('lastSubscribeTime');
const now = Date.now();
if (lastSubscribeTime && now - parseInt(lastSubscribeTime) < 5000) {
console.log('[responseErrorHandler] 刚完成开通跳过402处理');
showErrorMessage(responseMessage || '服务开通中,请稍后刷新页面');
return Promise.reject(new Error('模块开通中'));
}
const currentPath = window.location.hash.replace('#', '') || window.location.pathname;
console.log('[responseErrorHandler] 检测到HTTP 402错误当前路径:', currentPath);
handleModuleNotEnabled(currentPath);