sync: 同步总仓库 luoguang/monkey-ai weiyuan@bfdfb339 的 web/ 改动
同步基准:总仓库 a2ca13cb(= 本仓库初始导入 d8f3aee2) 范围:a2ca13cb..bfdfb339 中触及 web/ 的提交(不含 web/.claude/settings.local.json) - 8490ac02 feat(aliyun): integrate Wan 3 and Qwen Image models - 2aff08ec perf(analytics): 运营看板概览改读汇总表,首屏从 19s 降到 0.4s - dc69335e feat(experience): 体验中心图像/视频创作升级(能力 schema、估价、新创作台) - b059c657 fix(org): 下线 /org/create 自助加入企业页与 POST /api/org/join - 4fcf47e6 fix(i18n): 修复中/英/韩/繁体多语言错乱,补齐日/越/泰译文 - e4c301d5 fix: merge enterprise task record date filters - c9369b95 feat: expose enterprise image and video task records - a410fee5 feat(claude): 无断点请求自动注入 cache_control 断点(方案 2) - 521b3376 feat(claude): 缓存命中率优化——上游粘性路由 + 缓存时长强制改写 - 73b615dd feat(pricing): 企业成员不论登录身份均按所属企业等级计价与扣费 - f73f55c3 feat(client): 新增 WeyAi 版本说明管理与公开读取接口 - 8cdf1994 fix(topup): reset amount when switching from PayPal - 93a4ac34 feat(baidu): configure Seedance liveness header by channel - cb1818c5 fix(weyai): 按评审修正内容清理竞态、默认适用端与中文退回(M21) - 04214d83 feat(weyai): WeyAi 内容管理与客户端内容接口(M21 第二部分) - e3c4a57c feat(weyai): 设置页新增 WeyAi 页签与内容专用 COS 桶(M21 第一部分) - b5ee8e70 fix(auth): 会话角色/状态以 DB 为准,修复提升管理员后管理接口报权限不足 - e4618fc2 fix: 修复企业看板日志聚合死循环导致 CPU 打满,并降低看板查询开销 - 584aad52 style(web): 个人中心侧边栏按 prettier 换行 - b8d87064 fix: 小程序教程隐藏充值后保留原步骤编号,企业充值判断直接用 isMiniProgramWebView - eee7f5b2 fix: 小程序里企业首页不落到充值页,隐藏钱包入口与教程充值步骤 - 8b254d49 fix: 小程序里隐藏企业充值入口与页面 - a67661b4 fix(web): 小程序里个人中心默认页跳过充值和发票,避免来回跳转 - cff6c543 feat(web): WeyAi 小程序里打开个人中心时不出现充值和开票 - c6c99eb6 feat(billing): Claude 全部缓存写入统一按 1h 倍率计费 - 0699d1bf fix(web): 小程序 web-view 里注册页同样只显示站内方式 - 04853331 feat(web): WeyAi 小程序 web-view 里登录页只显示站内登录方式
This commit is contained in:
+35
-21
@@ -159,7 +159,7 @@ export function showError(error) {
|
||||
if (error.name === 'AxiosError') {
|
||||
// 检查 response 是否存在(网络错误时 response 为 undefined)
|
||||
if (!error.response) {
|
||||
Toast.error('错误:网络请求失败,请检查网络连接');
|
||||
Toast.error(i18next.t('错误:网络请求失败,请检查网络连接'));
|
||||
return;
|
||||
}
|
||||
switch (error.response.status) {
|
||||
@@ -178,26 +178,30 @@ export function showError(error) {
|
||||
window.location.href = `/org/login?expired=true${redirect}`;
|
||||
break;
|
||||
case 429:
|
||||
Toast.error('错误:请求次数过多,请稍后再试!');
|
||||
Toast.error(i18next.t('错误:请求次数过多,请稍后再试!'));
|
||||
break;
|
||||
case 500:
|
||||
Toast.error('错误:服务器内部错误,请联系管理员!');
|
||||
Toast.error(i18next.t('错误:服务器内部错误,请联系管理员!'));
|
||||
break;
|
||||
case 405:
|
||||
Toast.info('本站仅作演示之用,无服务端!');
|
||||
Toast.info(i18next.t('本站仅作演示之用,无服务端!'));
|
||||
break;
|
||||
default: {
|
||||
// 后端业务错误(4xx/5xx)带有面向用户的 message 字段;
|
||||
// 优先展示它,而不是 axios 的 "Request failed with status code XXX"。
|
||||
const backendMessage = error.response?.data?.message;
|
||||
Toast.error('错误:' + (backendMessage || error.message));
|
||||
Toast.error(
|
||||
i18next.t('错误:{{message}}', {
|
||||
message: backendMessage || error.message,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
Toast.error('错误:' + error.message);
|
||||
Toast.error(i18next.t('错误:{{message}}', { message: error.message }));
|
||||
} else {
|
||||
Toast.error('错误:' + error);
|
||||
Toast.error(i18next.t('错误:{{message}}', { message: error }));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -698,19 +702,19 @@ export const getRelativeTime = (publishDate) => {
|
||||
|
||||
// 根据时间差返回相应的描述
|
||||
if (diffSeconds < 60) {
|
||||
return '刚刚';
|
||||
return i18next.t('刚刚');
|
||||
} else if (diffMinutes < 60) {
|
||||
return `${diffMinutes} 分钟前`;
|
||||
return i18next.t('{{n}} 分钟前', { n: diffMinutes });
|
||||
} else if (diffHours < 24) {
|
||||
return `${diffHours} 小时前`;
|
||||
return i18next.t('{{n}} 小时前', { n: diffHours });
|
||||
} else if (diffDays < 7) {
|
||||
return `${diffDays} 天前`;
|
||||
return i18next.t('{{n}} 天前', { n: diffDays });
|
||||
} else if (diffWeeks < 4) {
|
||||
return `${diffWeeks} 周前`;
|
||||
return i18next.t('{{n}} 周前', { n: diffWeeks });
|
||||
} else if (diffMonths < 12) {
|
||||
return `${diffMonths} 个月前`;
|
||||
return i18next.t('{{n}} 个月前', { n: diffMonths });
|
||||
} else if (diffYears < 2) {
|
||||
return '1 年前';
|
||||
return i18next.t('{{n}} 年前', { n: 1 });
|
||||
} else {
|
||||
// 超过2年显示具体日期
|
||||
return formatDateString(pubDate);
|
||||
@@ -880,14 +884,20 @@ export const calculateModelPrice = ({
|
||||
const hasCacheCreation5m = hasNumericPriceValue(
|
||||
record.cache_creation_5m_ratio,
|
||||
);
|
||||
// 只有 1h 档(Claude:全部写入按 1h 计费)时不再重复展示通用缓存创建价
|
||||
const onlyCacheCreation1h =
|
||||
!hasCacheCreation5m &&
|
||||
hasNumericPriceValue(record.cache_creation_1h_ratio);
|
||||
const cacheCreationRatio = hasCacheCreation5m
|
||||
? record.cache_creation_5m_ratio
|
||||
: record.cache_creation_ratio;
|
||||
addExtraPrice(
|
||||
hasCacheCreation5m ? 'cache_creation_5m' : 'cache_creation',
|
||||
hasCacheCreation5m ? '缓存创建(5m)' : '缓存创建',
|
||||
cacheCreationRatio,
|
||||
);
|
||||
if (!onlyCacheCreation1h) {
|
||||
addExtraPrice(
|
||||
hasCacheCreation5m ? 'cache_creation_5m' : 'cache_creation',
|
||||
hasCacheCreation5m ? '缓存创建(5m)' : '缓存创建',
|
||||
cacheCreationRatio,
|
||||
);
|
||||
}
|
||||
addExtraPrice(
|
||||
'cache_creation_1h',
|
||||
'缓存创建(1h)',
|
||||
@@ -1111,13 +1121,17 @@ export const createCardProPagination = ({
|
||||
isMobile = false,
|
||||
pageSizeOpts = [10, 20, 50, 100],
|
||||
showSizeChanger = true,
|
||||
t = (key) => key,
|
||||
t = i18next.t.bind(i18next),
|
||||
}) => {
|
||||
if (!total || total <= 0) return null;
|
||||
|
||||
const start = (currentPage - 1) * pageSize + 1;
|
||||
const end = Math.min(currentPage * pageSize, total);
|
||||
const totalText = `${t('显示第')} ${start} ${t('条 - 第')} ${end} ${t('条,共')} ${total} ${t('条')}`;
|
||||
const totalText = t('显示第 {{start}} 条 - 第 {{end}} 条,共 {{total}} 条', {
|
||||
start,
|
||||
end,
|
||||
total,
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user