优化资产订阅页面,新增用户类型选择功能,支持在开通服务时选择租户模块类型,同时优化开通成功后的跳转逻辑,增加5秒内防重复触发402状态码的保护机制,避免开通完成后立即跳转又触发未开通提示的循环问题
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user