更新模型配置和订阅页面
- 修改模型模块的字段名称,从 `keyword` 更改为 `modelName`,以提高一致性。 - 添加模型类型和访问类型的选择功能,增强用户交互体验。 - 移除不必要的调试日志,优化代码整洁性。 - 更新订阅页面的错误处理逻辑,确保用户在加载失败时获得清晰反馈。
This commit is contained in:
@@ -5,10 +5,10 @@ const SUBSCRIBE_PAGE_URL = '/web/subscribe.html';
|
||||
const ROUTE_ASSET_MAP: Record<string, { assetId: string; serviceName: string }> = {
|
||||
// CID广告业务(聚合广告)
|
||||
'/cidService': { assetId: '696f423705e496ba4ccbe665', serviceName: '聚合广告' },
|
||||
|
||||
|
||||
// AI客服业务
|
||||
'/customerService': { assetId: '696f421205e496ba4ccbe662', serviceName: 'AI客服' },
|
||||
|
||||
|
||||
// 聚合电商业务(资产管理)
|
||||
'/assets': { assetId: '696b4acd1be1c8b76c4b4c15', serviceName: '资产管理' },
|
||||
};
|
||||
@@ -21,14 +21,14 @@ export function getAssetInfoByRoute(routePath: string): { assetId: string; servi
|
||||
if (ROUTE_ASSET_MAP[routePath]) {
|
||||
return ROUTE_ASSET_MAP[routePath];
|
||||
}
|
||||
|
||||
|
||||
// 前缀匹配
|
||||
for (const [prefix, info] of Object.entries(ROUTE_ASSET_MAP)) {
|
||||
if (routePath.startsWith(prefix)) {
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ export function redirectToSubscribePage(assetId: string) {
|
||||
const returnUrl = encodeURIComponent(window.location.href);
|
||||
// 构建跳转URL
|
||||
const url = `${SUBSCRIBE_PAGE_URL}?assetId=${assetId}&returnUrl=${returnUrl}`;
|
||||
console.log('[redirectToSubscribePage] 跳转到开通页面:', url);
|
||||
window.location.href = url;
|
||||
}
|
||||
|
||||
@@ -49,17 +48,13 @@ export function redirectToSubscribePage(assetId: string) {
|
||||
* 处理 402 错误码(模块未开通)
|
||||
*/
|
||||
export function handleModuleNotEnabled(routePath: string): boolean {
|
||||
console.log('[模块未开通] 当前路由路径:', routePath);
|
||||
const assetInfo = getAssetInfoByRoute(routePath);
|
||||
console.log('[模块未开通] 匹配到的资产信息:', assetInfo);
|
||||
|
||||
|
||||
if (assetInfo) {
|
||||
redirectToSubscribePage(assetInfo.assetId);
|
||||
return true;
|
||||
}
|
||||
|
||||
// 如果没有匹配到路由,尝试使用默认的资产管理
|
||||
console.warn('[模块未开通] 未匹配到路由,使用默认资产管理');
|
||||
|
||||
redirectToSubscribePage('696b4acd1be1c8b76c4b4c15');
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user