后台支付配置页面增加对应的数据

This commit is contained in:
2026-06-11 18:16:22 +08:00
parent 83e8ceee7e
commit e96f117bbb
@@ -22,8 +22,10 @@ const AdminPaymentConfig: React.FC = () => {
data.forEach((c: any) => { map[c.key] = c.value; });
form.setFieldsValue({
wechat_mch_id: map['payment_wechat_mch_id'] || '',
wechat_api_key: map['payment_wechat_api_key'] || '',
wechat_cert_path: map['payment_wechat_cert_path'] || '',
wechat_private_key: map['payment_wechat_private_key'] || '',
wechat_cert_serial_no: map['payment_wechat_cert_serial_no'] || '',
wechat_api_v3_key: map['payment_wechat_api_v3_key'] || '',
wechat_gateway: map['payment_wechat_gateway'] || '',
wechat_notify_url: map['payment_wechat_notify_url'] || '',
alipay_app_id: map['payment_alipay_app_id'] || '',
alipay_private_key: map['payment_alipay_private_key'] || '',
@@ -51,8 +53,10 @@ const AdminPaymentConfig: React.FC = () => {
payment_mock: String(mockMode),
payment_wechat_enabled: String(wechatEnabled),
payment_wechat_mch_id: values.wechat_mch_id || '',
payment_wechat_api_key: values.wechat_api_key || '',
payment_wechat_cert_path: values.wechat_cert_path || '',
payment_wechat_private_key: values.wechat_private_key || '',
payment_wechat_cert_serial_no: values.wechat_cert_serial_no || '',
payment_wechat_api_v3_key: values.wechat_api_v3_key || '',
payment_wechat_gateway: values.wechat_gateway || '',
payment_wechat_notify_url: values.wechat_notify_url || '',
payment_alipay_enabled: String(alipayEnabled),
payment_alipay_app_id: values.alipay_app_id || '',
@@ -150,13 +154,19 @@ const AdminPaymentConfig: React.FC = () => {
<Form.Item name="wechat_mch_id" label="商户号 (MchID)">
<Input placeholder="微信支付商户号" size="large" disabled={!wechatEnabled} />
</Form.Item>
<Form.Item name="wechat_api_key" label="API密钥">
<Input.Password placeholder="微信支付API密钥" size="large" disabled={!wechatEnabled} />
<Form.Item name="wechat_private_key" label="商户私钥">
<Input.TextArea rows={5} placeholder="商户私钥 (PEM格式,包含-----BEGIN PRIVATE KEY-----和-----END PRIVATE KEY-----)" disabled={!wechatEnabled} />
</Form.Item>
<Form.Item name="wechat_cert_path" label="证书路径">
<Input placeholder="apiclient_cert.pem 路径" size="large" disabled={!wechatEnabled} />
<Form.Item name="wechat_cert_serial_no" label="商户证书序列号">
<Input placeholder="商户证书序列号" size="large" disabled={!wechatEnabled} />
</Form.Item>
<Form.Item name="wechat_notify_url" label="回调地址">
<Form.Item name="wechat_api_v3_key" label="API v3 密钥">
<Input.Password placeholder="API v3 密钥" size="large" disabled={!wechatEnabled} />
</Form.Item>
<Form.Item name="wechat_gateway" label="网关地址" extra="正式环境: https://api.mch.weixin.qq.com 沙箱环境(如适用)">
<Input placeholder="https://api.mch.weixin.qq.com" size="large" disabled={!wechatEnabled} />
</Form.Item>
<Form.Item name="wechat_notify_url" label="回调地址" extra="用户支付成功后,微信会主动通知此地址,服务器收到通知后给用户加积分">
<Input placeholder="https://yourdomain.com/api/payments/wechat/callback" size="large" disabled={!wechatEnabled} />
</Form.Item>
</Form>