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:
@@ -139,7 +139,7 @@ export default function SettingsMembership() {
|
||||
}
|
||||
const { success, message } = res.data;
|
||||
if (success) {
|
||||
showSuccess(plan.id ? '更新成功' : '创建成功');
|
||||
showSuccess(plan.id ? t('更新成功') : t('创建成功'));
|
||||
setEditModalVisible(false);
|
||||
setEditingPlan(null);
|
||||
fetchPlans();
|
||||
@@ -192,7 +192,7 @@ export default function SettingsMembership() {
|
||||
// 表格列定义
|
||||
const columns = [
|
||||
{
|
||||
title: '方案名称',
|
||||
title: t('方案名称'),
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
render: (text, record) => (
|
||||
@@ -208,57 +208,57 @@ export default function SettingsMembership() {
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
title: t('类型'),
|
||||
dataIndex: 'plan_type',
|
||||
key: 'plan_type',
|
||||
render: (v) => {
|
||||
const map = { weekly: '周卡', monthly: '月卡', quarterly: '季卡' };
|
||||
return <Tag>{map[v] || v}</Tag>;
|
||||
return <Tag>{map[v] ? t(map[v]) : v}</Tag>;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '档位',
|
||||
title: t('档位'),
|
||||
dataIndex: 'tier',
|
||||
key: 'tier',
|
||||
render: (v) => {
|
||||
const map = { lite: '轻度', pro: '重度' };
|
||||
const color = v === 'pro' ? 'red' : 'blue';
|
||||
return <Tag color={color}>{map[v] || v}</Tag>;
|
||||
return <Tag color={color}>{map[v] ? t(map[v]) : v}</Tag>;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '天数',
|
||||
title: t('天数'),
|
||||
dataIndex: 'duration_days',
|
||||
key: 'duration_days',
|
||||
render: (v) => `${v} 天`,
|
||||
render: (v) => t('{{days}} 天', { days: v }),
|
||||
},
|
||||
{
|
||||
title: '价格',
|
||||
title: t('价格'),
|
||||
dataIndex: 'price',
|
||||
key: 'price',
|
||||
render: (v) => <Text strong>¥{v}</Text>,
|
||||
},
|
||||
{
|
||||
title: '每日额度',
|
||||
title: t('每日额度'),
|
||||
dataIndex: 'daily_quota',
|
||||
key: 'daily_quota',
|
||||
render: (v) => <Text type='success'>{renderQuota(v)}</Text>,
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
title: t('状态'),
|
||||
dataIndex: 'is_enabled',
|
||||
key: 'is_enabled',
|
||||
render: (v) => (
|
||||
<Tag color={v ? 'green' : 'grey'}>{v ? '启用' : '禁用'}</Tag>
|
||||
<Tag color={v ? 'green' : 'grey'}>{v ? t('启用') : t('禁用')}</Tag>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
title: t('排序'),
|
||||
dataIndex: 'sort',
|
||||
key: 'sort',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
title: t('操作'),
|
||||
key: 'action',
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
@@ -455,7 +455,10 @@ export default function SettingsMembership() {
|
||||
onChange={(v) =>
|
||||
setEditingPlan({ ...editingPlan, plan_type: v })
|
||||
}
|
||||
optionList={planTypeOptions}
|
||||
optionList={planTypeOptions.map((o) => ({
|
||||
...o,
|
||||
label: t(o.label),
|
||||
}))}
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
</div>
|
||||
@@ -467,7 +470,10 @@ export default function SettingsMembership() {
|
||||
<Select
|
||||
value={editingPlan.tier}
|
||||
onChange={(v) => setEditingPlan({ ...editingPlan, tier: v })}
|
||||
optionList={tierOptions}
|
||||
optionList={tierOptions.map((o) => ({
|
||||
...o,
|
||||
label: t(o.label),
|
||||
}))}
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -83,7 +83,12 @@ const SettingsPaymentAlipay = ({ options, refresh }) => {
|
||||
for (const config of configs) {
|
||||
const res = await API.put('/api/option/', config);
|
||||
if (!res.data.success) {
|
||||
throw new Error(`保存 ${config.key} 失败: ${res.data.message}`);
|
||||
throw new Error(
|
||||
t('保存 {{key}} 失败:{{message}}', {
|
||||
key: config.key,
|
||||
message: res.data.message,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -225,7 +225,12 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
if (!response.data.success)
|
||||
throw new Error(response.data.message || t('查询失败'));
|
||||
const data = response.data.data;
|
||||
showSuccess(`${tradeNo}:PayPal 状态 ${data.remote_status}`);
|
||||
showSuccess(
|
||||
t('{{tradeNo}}:PayPal 状态 {{status}}', {
|
||||
tradeNo,
|
||||
status: data.remote_status,
|
||||
}),
|
||||
);
|
||||
setSelectedOperationOrderKeys((keys) =>
|
||||
keys.filter((key) => key !== String(tradeNo)),
|
||||
);
|
||||
@@ -326,7 +331,12 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
(item) => !item.success,
|
||||
);
|
||||
showSuccess(
|
||||
`批量${operation === 'inspect' ? '查询' : '对账'}完成:成功 ${data.succeeded || 0} 笔,失败 ${data.failed || 0} 笔`,
|
||||
t(
|
||||
operation === 'inspect'
|
||||
? t('批量查询完成:成功 {{succeeded}} 笔,失败 {{failed}} 笔')
|
||||
: '批量对账完成:成功 {{succeeded}} 笔,失败 {{failed}} 笔',
|
||||
{ succeeded: data.succeeded || 0, failed: data.failed || 0 },
|
||||
),
|
||||
);
|
||||
if (failedResults.length > 0) {
|
||||
showError(
|
||||
@@ -356,8 +366,8 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
setBatchForceConfirmed(false);
|
||||
setBatchExpireReason(
|
||||
force
|
||||
? '管理员确认远端状态无法核验,强制关闭所选 PayPal 订单'
|
||||
: '确认所选 PayPal 订单均未完成支付',
|
||||
? t('管理员确认远端状态无法核验,强制关闭所选 PayPal 订单')
|
||||
: t('确认所选 PayPal 订单均未完成支付'),
|
||||
);
|
||||
};
|
||||
|
||||
@@ -390,7 +400,12 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
(item) => !item.success,
|
||||
);
|
||||
showSuccess(
|
||||
`批量${batchExpire.force ? '强制' : ''}过期完成:成功 ${data.succeeded || 0} 笔,失败 ${data.failed || 0} 笔`,
|
||||
t(
|
||||
batchExpire.force
|
||||
? t('批量强制过期完成:成功 {{succeeded}} 笔,失败 {{failed}} 笔')
|
||||
: '批量过期完成:成功 {{succeeded}} 笔,失败 {{failed}} 笔',
|
||||
{ succeeded: data.succeeded || 0, failed: data.failed || 0 },
|
||||
),
|
||||
);
|
||||
if (failedResults.length > 0) {
|
||||
showError(
|
||||
@@ -527,7 +542,9 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
<Form.Section text={t('PayPal 设置')}>
|
||||
<Banner
|
||||
type='info'
|
||||
description={`${t('Webhook 地址')}:${webhookBase}/api/paypal/webhook`}
|
||||
description={t('Webhook 地址:{{url}}', {
|
||||
url: `${webhookBase}/api/paypal/webhook`,
|
||||
})}
|
||||
/>
|
||||
{isRoot() && (
|
||||
<>
|
||||
@@ -614,12 +631,13 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
type={operations?.pending_count ? 'warning' : 'success'}
|
||||
description={
|
||||
operations
|
||||
? `配置切换预检:${operations.pending_count || 0} 笔 PayPal pending 订单;${
|
||||
? t(
|
||||
operations.can_change_config
|
||||
? '可以切换环境或应用配置'
|
||||
: '请先隐藏新订单并完成历史订单排空'
|
||||
}`
|
||||
: '正在读取 PayPal 配置切换预检状态'
|
||||
? t('配置切换预检:{{n}} 笔 PayPal pending 订单;可以切换环境或应用配置')
|
||||
: '配置切换预检:{{n}} 笔 PayPal pending 订单;请先隐藏新订单并完成历史订单排空',
|
||||
{ n: operations.pending_count || 0 },
|
||||
)
|
||||
: t('正在读取 PayPal 配置切换预检状态')
|
||||
}
|
||||
style={{ marginTop: 16 }}
|
||||
/>
|
||||
@@ -629,7 +647,9 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
style={{ marginTop: 12 }}
|
||||
>
|
||||
<Text type='tertiary'>
|
||||
已选 {selectedOperationOrderKeys.length} 笔
|
||||
{t('已选 {{n}} 笔', {
|
||||
n: selectedOperationOrderKeys.length,
|
||||
})}
|
||||
</Text>
|
||||
<Button
|
||||
size='small'
|
||||
@@ -637,7 +657,7 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
disabled={selectedOperationOrderKeys.length === 0}
|
||||
onClick={() => runBatchOperation('inspect')}
|
||||
>
|
||||
批量查询远端状态
|
||||
{t('批量查询远端状态')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
@@ -646,7 +666,7 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
disabled={selectedOperationOrderKeys.length === 0}
|
||||
onClick={() => runBatchOperation('reconcile')}
|
||||
>
|
||||
批量触发对账
|
||||
{t('批量触发对账')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
@@ -655,7 +675,7 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
disabled={selectedOperationOrderKeys.length === 0}
|
||||
onClick={() => openBatchExpire(false)}
|
||||
>
|
||||
批量确认过期
|
||||
{t('批量确认过期')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
@@ -664,7 +684,7 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
disabled={selectedOperationOrderKeys.length === 0}
|
||||
onClick={() => openBatchExpire(true)}
|
||||
>
|
||||
批量强制过期
|
||||
{t('批量强制过期')}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
@@ -691,17 +711,17 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
scroll={{ x: 900 }}
|
||||
style={{ marginTop: 12 }}
|
||||
columns={[
|
||||
{ title: '本地订单号', dataIndex: 'trade_no' },
|
||||
{ title: t('本地订单号'), dataIndex: 'trade_no' },
|
||||
{ title: 'PayPal Order ID', dataIndex: 'third_trade_no' },
|
||||
{ title: '环境', dataIndex: 'payment_environment' },
|
||||
{ title: t('环境'), dataIndex: 'payment_environment' },
|
||||
{
|
||||
title: '创建时间',
|
||||
title: t('创建时间'),
|
||||
dataIndex: 'create_time',
|
||||
render: (value) =>
|
||||
value ? new Date(value * 1000).toLocaleString() : '-',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
title: t('操作'),
|
||||
render: (_, row) => (
|
||||
<div className='flex flex-wrap gap-2'>
|
||||
<Button
|
||||
@@ -709,7 +729,7 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
htmlType='button'
|
||||
onClick={() => inspectOperationOrder(row.trade_no)}
|
||||
>
|
||||
查询远端状态
|
||||
{t('查询远端状态')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
@@ -720,7 +740,7 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
}
|
||||
disabled={!row.third_trade_no}
|
||||
>
|
||||
触发对账
|
||||
{t('触发对账')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
@@ -730,10 +750,10 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
setExpireOrder(row);
|
||||
setForceExpire(false);
|
||||
setForceExpireConfirmed(false);
|
||||
setExpireReason('确认该订单未完成 PayPal 支付');
|
||||
setExpireReason(t('确认该订单未完成 PayPal 支付'));
|
||||
}}
|
||||
>
|
||||
确认未付款并过期
|
||||
{t('确认未付款并过期')}
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
@@ -744,11 +764,13 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
setForceExpire(true);
|
||||
setForceExpireConfirmed(false);
|
||||
setExpireReason(
|
||||
'管理员确认远端状态无法核验,强制关闭该 PayPal 订单',
|
||||
t(
|
||||
'管理员确认远端状态无法核验,强制关闭该 PayPal 订单',
|
||||
),
|
||||
);
|
||||
}}
|
||||
>
|
||||
强制过期
|
||||
{t('强制过期')}
|
||||
</Button>
|
||||
</div>
|
||||
),
|
||||
@@ -763,7 +785,7 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
onClick={() => refreshOperations(operationsPage)}
|
||||
style={{ marginTop: 12 }}
|
||||
>
|
||||
刷新配置切换预检
|
||||
{t('刷新配置切换预检')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
@@ -848,7 +870,9 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
type={fxStatus?.latest_valid ? 'success' : 'warning'}
|
||||
description={
|
||||
fxStatus?.latest_valid
|
||||
? `${t('当前市场汇率')}:1 USD = ${fxStatus.latest_valid.market_rate} CNY`
|
||||
? t('当前市场汇率:1 USD = {{rate}} CNY', {
|
||||
rate: fxStatus.latest_valid.market_rate,
|
||||
})
|
||||
: t('暂无可用的市场汇率快照')
|
||||
}
|
||||
style={{ marginTop: 16 }}
|
||||
@@ -868,25 +892,25 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
</Form>
|
||||
<Modal
|
||||
title={
|
||||
forceExpire ? '确认强制过期 PayPal 订单' : '确认 PayPal 订单过期'
|
||||
forceExpire ? t('确认强制过期 PayPal 订单') : t('确认 PayPal 订单过期')
|
||||
}
|
||||
visible={Boolean(expireOrder)}
|
||||
onCancel={() => setExpireOrder(null)}
|
||||
onOk={expireOperationOrder}
|
||||
okText='确认过期'
|
||||
cancelText='取消'
|
||||
okText={t('确认过期')}
|
||||
cancelText={t('取消')}
|
||||
>
|
||||
{expireOrder && (
|
||||
<div className='space-y-3'>
|
||||
<Text>
|
||||
订单:<strong>{expireOrder.trade_no}</strong>
|
||||
{t('订单')}:<strong>{expireOrder.trade_no}</strong>
|
||||
</Text>
|
||||
<Banner
|
||||
type={forceExpire ? 'danger' : 'warning'}
|
||||
description={
|
||||
forceExpire
|
||||
? '强制过期会绕过远端查询失败或仍可支付状态,可能导致 PayPal 后续付款无法入账。已确认完成支付的订单仍会被拒绝。'
|
||||
: '系统会再次查询 PayPal 远端状态;如果已完成支付,将拒绝过期操作。请确认未付款后再提交。'
|
||||
? t('强制过期会绕过远端查询失败或仍可支付状态,可能导致 PayPal 后续付款无法入账。已确认完成支付的订单仍会被拒绝。')
|
||||
: t('系统会再次查询 PayPal 远端状态;如果已完成支付,将拒绝过期操作。请确认未付款后再提交。')
|
||||
}
|
||||
/>
|
||||
{forceExpire && (
|
||||
@@ -898,7 +922,7 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
)
|
||||
}
|
||||
>
|
||||
我确认已核对 PayPal 后台或业务记录,同意强制关闭该订单
|
||||
{t('我确认已核对 PayPal 后台或业务记录,同意强制关闭该订单')}
|
||||
</Checkbox>
|
||||
)}
|
||||
<TextArea
|
||||
@@ -911,7 +935,7 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
)
|
||||
}
|
||||
rows={3}
|
||||
placeholder='填写处置原因,至少 6 个字符'
|
||||
placeholder={t('填写处置原因,至少 6 个字符')}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -919,24 +943,28 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
<Modal
|
||||
title={
|
||||
batchExpire?.force
|
||||
? '确认批量强制过期 PayPal 订单'
|
||||
: '确认批量 PayPal 订单过期'
|
||||
? t('确认批量强制过期 PayPal 订单')
|
||||
: t('确认批量 PayPal 订单过期')
|
||||
}
|
||||
visible={Boolean(batchExpire)}
|
||||
onCancel={() => setBatchExpire(null)}
|
||||
onOk={confirmBatchExpire}
|
||||
okText='确认批量过期'
|
||||
cancelText='取消'
|
||||
okText={t('确认批量过期')}
|
||||
cancelText={t('取消')}
|
||||
>
|
||||
{batchExpire && (
|
||||
<div className='space-y-3'>
|
||||
<Text>已选择 {batchExpire.tradeNos.length} 笔 PayPal 订单。</Text>
|
||||
<Text>
|
||||
{t('已选择 {{n}} 笔 PayPal 订单。', {
|
||||
n: batchExpire.tradeNos.length,
|
||||
})}
|
||||
</Text>
|
||||
<Banner
|
||||
type={batchExpire.force ? 'danger' : 'warning'}
|
||||
description={
|
||||
batchExpire.force
|
||||
? '批量强制过期会绕过远端查询失败或仍可支付状态;已确认完成支付的订单仍会逐笔拒绝。'
|
||||
: '系统会逐笔查询 PayPal 远端状态,已完成或仍可支付的订单会逐笔失败并返回原因。'
|
||||
? t('批量强制过期会绕过远端查询失败或仍可支付状态;已确认完成支付的订单仍会逐笔拒绝。')
|
||||
: t('系统会逐笔查询 PayPal 远端状态,已完成或仍可支付的订单会逐笔失败并返回原因。')
|
||||
}
|
||||
/>
|
||||
{batchExpire.force && (
|
||||
@@ -948,7 +976,7 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
)
|
||||
}
|
||||
>
|
||||
我确认已核对所选订单,同意批量强制关闭
|
||||
{t('我确认已核对所选订单,同意批量强制关闭')}
|
||||
</Checkbox>
|
||||
)}
|
||||
<TextArea
|
||||
@@ -961,7 +989,7 @@ export default function SettingsPaymentGatewayPayPal(props) {
|
||||
)
|
||||
}
|
||||
rows={3}
|
||||
placeholder='填写处置原因,至少 6 个字符'
|
||||
placeholder={t('填写处置原因,至少 6 个字符')}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -167,7 +167,7 @@ export default function SettingsPaymentGateway(props) {
|
||||
>
|
||||
<Form.Section text={t('Stripe 设置')}>
|
||||
<Text>
|
||||
Stripe 密钥、Webhook 等设置请
|
||||
{t('Stripe 密钥、Webhook 等设置请')}
|
||||
<a
|
||||
href='https://dashboard.stripe.com/developers'
|
||||
target='_blank'
|
||||
@@ -180,11 +180,15 @@ export default function SettingsPaymentGateway(props) {
|
||||
</Text>
|
||||
<Banner
|
||||
type='info'
|
||||
description={`Webhook 填:${props.options.ServerAddress ? removeTrailingSlash(props.options.ServerAddress) : t('网站地址')}/api/stripe/webhook`}
|
||||
description={t('Webhook 填:{{url}}', {
|
||||
url: `${props.options.ServerAddress ? removeTrailingSlash(props.options.ServerAddress) : t('网站地址')}/api/stripe/webhook`,
|
||||
})}
|
||||
/>
|
||||
<Banner
|
||||
type='warning'
|
||||
description={`需要包含事件:checkout.session.completed 和 checkout.session.expired`}
|
||||
description={t(
|
||||
'需要包含事件:checkout.session.completed 和 checkout.session.expired',
|
||||
)}
|
||||
/>
|
||||
<Row gutter={{ xs: 8, sm: 16, md: 24, lg: 24, xl: 24, xxl: 24 }}>
|
||||
<Col xs={24} sm={24} md={8} lg={8} xl={8}>
|
||||
|
||||
@@ -109,7 +109,12 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
|
||||
for (const config of configs) {
|
||||
const res = await API.put('/api/option/', config);
|
||||
if (!res.data.success) {
|
||||
throw new Error(`保存 ${config.key} 失败: ${res.data.message}`);
|
||||
throw new Error(
|
||||
t('保存 {{key}} 失败:{{message}}', {
|
||||
key: config.key,
|
||||
message: res.data.message,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,13 +131,13 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
|
||||
<>
|
||||
<Title heading={5}>{t('微信支付配置')}</Title>
|
||||
<Text type='tertiary'>
|
||||
配置微信支付 Native(扫码)和 H5 支付方式。请前往{' '}
|
||||
{t('配置微信支付 Native(扫码)和 H5 支付方式。请前往')}{' '}
|
||||
<a
|
||||
href='https://pay.weixin.qq.com'
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
>{t('微信支付商户平台')}</a>{' '}
|
||||
获取相关配置信息。
|
||||
{t('获取相关配置信息。')}
|
||||
</Text>
|
||||
|
||||
<Divider margin='12px' />
|
||||
@@ -183,14 +188,14 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
|
||||
field='WechatMchId'
|
||||
label={t('商户号 (Mch ID)')}
|
||||
placeholder={t('请输入微信支付商户号')}
|
||||
rules={[{ required: true, message: '请输入商户号' }]}
|
||||
rules={[{ required: true, message: t('请输入商户号') }]}
|
||||
/>
|
||||
|
||||
<Form.Input
|
||||
field='WechatAppId'
|
||||
label={t('应用 ID (App ID)')}
|
||||
placeholder={t('请输入微信应用 ID')}
|
||||
rules={[{ required: true, message: '请输入应用 ID' }]}
|
||||
rules={[{ required: true, message: t('请输入应用 ID') }]}
|
||||
/>
|
||||
|
||||
<Form.Input
|
||||
@@ -198,13 +203,13 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
|
||||
label={t('APIv3 密钥')}
|
||||
placeholder={
|
||||
options.WechatAPIv3Key === '***ALREADY_SET***'
|
||||
? '已设置(留空不修改,填写新内容则更新)'
|
||||
: '请输入 APIv3 密钥'
|
||||
? t('已设置(留空不修改,填写新内容则更新)')
|
||||
: t('请输入 APIv3 密钥')
|
||||
}
|
||||
mode='password'
|
||||
extraText={
|
||||
options.WechatAPIv3Key === '***ALREADY_SET***'
|
||||
? '✓ 已配置 APIv3 密钥(留空则保持不变)'
|
||||
? t('✓ 已配置 APIv3 密钥(留空则保持不变)')
|
||||
: ''
|
||||
}
|
||||
/>
|
||||
@@ -213,7 +218,7 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
|
||||
field='WechatSerialNo'
|
||||
label={t('证书序列号')}
|
||||
placeholder={t('请输入证书序列号')}
|
||||
rules={[{ required: true, message: '请输入证书序列号' }]}
|
||||
rules={[{ required: true, message: t('请输入证书序列号') }]}
|
||||
/>
|
||||
|
||||
<Form.TextArea
|
||||
@@ -221,14 +226,14 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
|
||||
label={t('商户私钥')}
|
||||
placeholder={
|
||||
options.WechatPrivateKey === '***ALREADY_SET***'
|
||||
? '已设置(留空不修改,填写新内容则更新)'
|
||||
: '请粘贴完整的 PEM 格式私钥内容(包含 -----BEGIN PRIVATE KEY----- 等)'
|
||||
? t('已设置(留空不修改,填写新内容则更新)')
|
||||
: t('请粘贴完整的 PEM 格式私钥内容(包含 -----BEGIN PRIVATE KEY----- 等)')
|
||||
}
|
||||
rows={6}
|
||||
extraText={
|
||||
options.WechatPrivateKey === '***ALREADY_SET***'
|
||||
? '✓ 已配置商户私钥(留空则保持不变)'
|
||||
: '支持直接粘贴 PEM 格式内容或填写文件路径'
|
||||
? t('✓ 已配置商户私钥(留空则保持不变)')
|
||||
: t('支持直接粘贴 PEM 格式内容或填写文件路径')
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -236,21 +241,22 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
|
||||
|
||||
<Title heading={6} style={{ marginTop: 16, marginBottom: 8 }}>{t('公钥模式(2024年新商户必选)')}</Title>
|
||||
<Text type='tertiary' style={{ display: 'block', marginBottom: 12 }}>
|
||||
2024年后注册的微信支付商户默认使用公钥模式。如果初始化失败提示"无可用的平台证书",
|
||||
请从商户平台下载微信支付公钥并启用此模式。
|
||||
{t(
|
||||
'2024年后注册的微信支付商户默认使用公钥模式。如果初始化失败提示"无可用的平台证书",请从商户平台下载微信支付公钥并启用此模式。',
|
||||
)}
|
||||
</Text>
|
||||
|
||||
<Form.Switch
|
||||
field='WechatUsePublicKey'
|
||||
label={t('启用公钥模式')}
|
||||
extraText='2024年新商户必须开启此选项'
|
||||
extraText={t('2024年新商户必须开启此选项')}
|
||||
/>
|
||||
|
||||
<Form.Input
|
||||
field='WechatPublicKeyID'
|
||||
label={t('微信支付公钥 ID')}
|
||||
placeholder='PUB_KEY_ID_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
||||
extraText='从商户平台【API安全】→【微信支付公钥】获取,格式如 PUB_KEY_ID_xxx'
|
||||
extraText={t('从商户平台【API安全】→【微信支付公钥】获取,格式如 PUB_KEY_ID_xxx')}
|
||||
/>
|
||||
|
||||
<Form.TextArea
|
||||
@@ -258,14 +264,14 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
|
||||
label={t('微信支付公钥内容')}
|
||||
placeholder={
|
||||
options.WechatPublicKeyPEM === '***ALREADY_SET***'
|
||||
? '已设置(留空不修改,填写新内容则更新)'
|
||||
: '请粘贴完整的微信支付公钥 PEM 内容(包含 -----BEGIN PUBLIC KEY----- 等)'
|
||||
? t('已设置(留空不修改,填写新内容则更新)')
|
||||
: t('请粘贴完整的微信支付公钥 PEM 内容(包含 -----BEGIN PUBLIC KEY----- 等)')
|
||||
}
|
||||
rows={6}
|
||||
extraText={
|
||||
options.WechatPublicKeyPEM === '***ALREADY_SET***'
|
||||
? '✓ 已配置微信支付公钥(留空则保持不变)'
|
||||
: '从商户平台下载的公钥文件内容'
|
||||
? t('✓ 已配置微信支付公钥(留空则保持不变)')
|
||||
: t('从商户平台下载的公钥文件内容')
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -277,14 +283,14 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
|
||||
<Form.Switch
|
||||
field='WechatUseManualCert'
|
||||
label={t('启用手动证书模式')}
|
||||
extraText='开启后需要手动配置平台证书,关闭则使用自动下载模式(推荐)'
|
||||
extraText={t('开启后需要手动配置平台证书,关闭则使用自动下载模式(推荐)')}
|
||||
/>
|
||||
|
||||
<Form.Input
|
||||
field='WechatPlatformCertPath'
|
||||
label={t('平台证书文件路径')}
|
||||
placeholder='/data/certs/wechatpay_platform_cert.pem'
|
||||
extraText='平台证书文件的绝对路径(与下方 PEM 内容二选一)'
|
||||
extraText={t('平台证书文件的绝对路径(与下方 PEM 内容二选一)')}
|
||||
/>
|
||||
|
||||
<Form.TextArea
|
||||
@@ -292,14 +298,14 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
|
||||
label={t('平台证书 PEM 内容')}
|
||||
placeholder={
|
||||
options.WechatPlatformCertPEM === '***ALREADY_SET***'
|
||||
? '已设置(留空不修改,填写新内容则更新)'
|
||||
: '请粘贴完整的平台证书 PEM 内容(包含 -----BEGIN CERTIFICATE----- 等)'
|
||||
? t('已设置(留空不修改,填写新内容则更新)')
|
||||
: t('请粘贴完整的平台证书 PEM 内容(包含 -----BEGIN CERTIFICATE----- 等)')
|
||||
}
|
||||
rows={6}
|
||||
extraText={
|
||||
options.WechatPlatformCertPEM === '***ALREADY_SET***'
|
||||
? '✓ 已配置平台证书(留空则保持不变)'
|
||||
: '与上方文件路径二选一,优先使用文件路径'
|
||||
? t('✓ 已配置平台证书(留空则保持不变)')
|
||||
: t('与上方文件路径二选一,优先使用文件路径')
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -308,13 +314,13 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
|
||||
<Form.Switch
|
||||
field='WechatNativeEnabled'
|
||||
label={t('启用 Native 扫码支付')}
|
||||
extraText='用户扫描二维码完成支付'
|
||||
extraText={t('用户扫描二维码完成支付')}
|
||||
/>
|
||||
|
||||
<Form.Switch
|
||||
field='WechatH5Enabled'
|
||||
label={t('启用 H5 支付')}
|
||||
extraText='在手机浏览器中唤起微信支付'
|
||||
extraText={t('在手机浏览器中唤起微信支付')}
|
||||
/>
|
||||
|
||||
<Divider margin='12px' />
|
||||
@@ -323,14 +329,14 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
|
||||
field='WechatNotifyUrl'
|
||||
label={t('回调通知 URL')}
|
||||
placeholder={t('留空则使用默认地址')}
|
||||
extraText='默认: {服务器地址}/api/wechat/notify'
|
||||
extraText={t('默认: {服务器地址}/api/wechat/notify')}
|
||||
/>
|
||||
|
||||
<Form.Input
|
||||
field='WechatDescription'
|
||||
label={t('商品描述')}
|
||||
placeholder={t('平台充值')}
|
||||
extraText='显示在微信支付界面的商品描述'
|
||||
extraText={t('显示在微信支付界面的商品描述')}
|
||||
/>
|
||||
|
||||
<Form.InputNumber
|
||||
@@ -338,7 +344,7 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
|
||||
label={t('订单过期时间(分钟)')}
|
||||
min={1}
|
||||
max={1440}
|
||||
extraText='订单未支付的有效时间,默认 30 分钟'
|
||||
extraText={t('订单未支付的有效时间,默认 30 分钟')}
|
||||
/>
|
||||
|
||||
<Space style={{ marginTop: 20 }}>
|
||||
|
||||
Reference in New Issue
Block a user