fix(admin): restore Vite admin source files

This commit is contained in:
2026-08-17 20:02:36 +08:00
parent 8fe3a89c36
commit ac5c0b2dd7
114 changed files with 17272 additions and 0 deletions
@@ -0,0 +1,59 @@
export const cardPassSchema = {
key: 'payment.card-pass',
title: '充值卡',
icon: 'fas fa-ticket-alt',
description: '配置充值卡类型、卡号规则、批量生成和兑换逻辑。',
defaults: {
card_pass_enabled: false,
card_pass_desc: '',
card_pass_type: 'balance',
card_pass_prefix: 'AK',
card_pass_length: 16,
card_pass_batch_size: 50,
card_pass_max_redeem: 1,
card_pass_expiry: 0,
card_pass_amount: 10,
card_pass_vip_days: 30,
card_pass_credits: 0,
card_pass_redeem_page: '',
card_pass_success_msg: '兑换成功!',
card_pass_fail_msg: '卡号无效或已过期',
},
groups: [
{
key: 'basic',
title: '充值卡设置',
icon: 'fas fa-id-card',
fields: [
{ key: 'card_pass_enabled', label: '启用充值卡', type: 'switch', default: false },
{ key: 'card_pass_desc', label: '充值卡说明', type: 'textarea', default: '', dependsOn: { key: 'card_pass_enabled', value: true } },
{ key: 'card_pass_type', label: '充值卡类型', type: 'select', default: 'balance', options: [{ label: '余额卡', value: 'balance' }, { label: 'VIP卡', value: 'vip' }, { label: '积分卡', value: 'credits' }], dependsOn: { key: 'card_pass_enabled', value: true } },
{ key: 'card_pass_prefix', label: '卡号前缀', type: 'input', default: 'AK', dependsOn: { key: 'card_pass_enabled', value: true } },
{ key: 'card_pass_length', label: '卡号长度', type: 'number', default: 16, min: 8, max: 32, dependsOn: { key: 'card_pass_enabled', value: true } },
{ key: 'card_pass_batch_size', label: '批量生成数量', type: 'number', default: 50, min: 1, max: 500, dependsOn: { key: 'card_pass_enabled', value: true } },
],
},
{
key: 'redeem',
title: '兑换设置',
icon: 'fas fa-exchange-alt',
fields: [
{ key: 'card_pass_max_redeem', label: '单卡最大兑换次数', type: 'number', default: 1, min: 1, max: 100, dependsOn: { key: 'card_pass_enabled', value: true } },
{ key: 'card_pass_expiry', label: '有效期(天)', type: 'number', default: 0, min: 0, help: '0为永久有效', dependsOn: { key: 'card_pass_enabled', value: true } },
{ key: 'card_pass_amount', label: '面额(元)', type: 'number', default: 10, min: 1, max: 9999, dependsOn: { key: 'card_pass_enabled', value: true } },
{ key: 'card_pass_vip_days', label: 'VIP天数', type: 'number', default: 30, min: 1, max: 3650, dependsOn: { key: 'card_pass_enabled', value: true } },
{ key: 'card_pass_credits', label: '赠送积分', type: 'number', default: 0, min: 0, max: 99999, dependsOn: { key: 'card_pass_enabled', value: true } },
],
},
{
key: 'display',
title: '展示设置',
icon: 'fas fa-desktop',
fields: [
{ key: 'card_pass_redeem_page', label: '兑换页面', type: 'input', default: '', dependsOn: { key: 'card_pass_enabled', value: true } },
{ key: 'card_pass_success_msg', label: '兑换成功提示', type: 'input', default: '兑换成功!', dependsOn: { key: 'card_pass_enabled', value: true } },
{ key: 'card_pass_fail_msg', label: '兑换失败提示', type: 'input', default: '卡号无效或已过期', dependsOn: { key: 'card_pass_enabled', value: true } },
],
},
],
}
@@ -0,0 +1,167 @@
export const gatewaySchema = {
key: 'payment.gateway',
title: '收款接口',
icon: 'fas fa-credit-card',
description: '管理已支持的收款通道:余额、支付宝、微信、PayPal、Stripe、易支付与卡密兑换。开启渠道后展开填写凭据。',
defaults: {
payment_wechat_enabled: false,
payment_alipay_enabled: false,
payment_paypal_enabled: false,
payment_stripe_enabled: false,
payment_epay_enabled: false,
payment_balance_enabled: true,
payment_card_pass_enabled: false,
wechat_merchantid: '',
wechat_appid: '',
wechat_payment_type: 'native',
wechat_api_v3_key: '',
wechat_private_key_path: '',
wechat_cert_path: '',
alipay_appid: '',
alipay_privatekey: '',
alipay_payment_type: 'page',
alipay_app_public_cert_path: '',
alipay_public_cert_path: '',
alipay_root_cert_path: '',
paypal_client_id: '',
paypal_client_secret: '',
paypal_currency: 'USD',
paypal_sandbox: true,
stripe_secret_key: '',
stripe_publishable_key: '',
stripe_webhook_secret: '',
stripe_currency: 'usd',
stripe_test_mode: true,
epay_apiurl: '',
epay_pid: '',
epay_key: '',
epay_channel_alipay: true,
epay_channel_wxpay: true,
epay_device: 'auto',
},
groups: [
{
key: 'notice',
title: '说明',
icon: 'fas fa-info-circle',
fields: [
{
key: 'payment_gateway_notice',
label: '通道说明',
type: 'notice',
alertType: 'info',
alertContent: '以渠道开关 + 凭据是否齐全为准。异步回调由各网关验签(支付宝/微信/Stripe/易支付等),无需额外口令。卡密为兑换入口,不出现在收银台支付方式列表。',
},
],
},
{
key: 'gateways',
title: '支付渠道开关',
icon: 'fas fa-toggle-on',
description: '先开启渠道,下方对应配置卡片会展开;填写凭据后网关状态变为可用。余额与卡密无第三方凭据,仅开关即可。',
fields: [
{ key: 'payment_balance_enabled', label: '余额支付', type: 'switch', default: true, help: '需同时在「余额充值」启用余额功能。关闭后用户中心仍可有钱包,但结账不可用余额支付。' },
{ key: 'payment_alipay_enabled', label: '支付宝', type: 'switch', default: false },
{ key: 'payment_wechat_enabled', label: '微信支付', type: 'switch', default: false },
{ key: 'payment_paypal_enabled', label: 'PayPal', type: 'switch', default: false },
{ key: 'payment_stripe_enabled', label: 'Stripe', type: 'switch', default: false },
{ key: 'payment_epay_enabled', label: '易支付', type: 'switch', default: false, help: '兼容彩虹易支付协议的聚合收银台,可同时开启支付宝/微信子通道。' },
{ key: 'payment_card_pass_enabled', label: '卡密充值', type: 'switch', default: false, help: '仅控制卡密兑换入口是否开放;卡密规则与批量发卡在「充值卡」页。不进入结账支付方式列表。' },
],
},
{
key: 'wechat',
title: '微信支付配置',
icon: 'fab fa-weixin',
description: '开启「微信支付」后填写商户号与密钥。',
collapsible: true,
expandWhen: 'payment_wechat_enabled',
dependsOn: { key: 'payment_wechat_enabled', value: true },
fields: [
{ key: 'wechat_merchantid', label: '商户号', type: 'input', default: '' },
{ key: 'wechat_appid', label: 'AppID', type: 'input', default: '' },
{ key: 'wechat_payment_type', label: '支付方式', type: 'select', default: 'native', options: [
{ label: '扫码支付(Native)', value: 'native' },
{ label: 'H5支付', value: 'h5' },
] },
{ key: 'wechat_api_v3_key', label: 'APIv3密钥', type: 'input', default: '', help: '微信商户平台设置的 APIv3 密钥(32位)。' },
{ key: 'wechat_private_key_path', label: '商户私钥路径', type: 'input', default: '', help: 'apiclient_key.pem 绝对路径,用于签名。' },
{ key: 'wechat_cert_path', label: '商户API证书路径', type: 'input', default: '', help: 'apiclient_cert.pem 绝对路径。' },
],
},
{
key: 'alipay',
title: '支付宝配置',
icon: 'fab fa-alipay',
description: '开启「支付宝」后填写应用与证书。',
collapsible: true,
expandWhen: 'payment_alipay_enabled',
dependsOn: { key: 'payment_alipay_enabled', value: true },
fields: [
{ key: 'alipay_appid', label: 'AppID', type: 'input', default: '' },
{ key: 'alipay_privatekey', label: '应用私钥', type: 'textarea', rows: 3, default: '' },
{ key: 'alipay_payment_type', label: '支付方式', type: 'select', default: 'page', options: [
{ label: '电脑网站支付(web)', value: 'page' },
{ label: '手机网站支付(wap)', value: 'wap' },
] },
{ key: 'alipay_app_public_cert_path', label: '应用公钥证书路径', type: 'input', default: '', help: 'appCertPublicKey.crt 绝对路径。' },
{ key: 'alipay_public_cert_path', label: '支付宝公钥证书路径', type: 'input', default: '', help: 'alipayCertPublicKey_RSA2.crt 绝对路径。' },
{ key: 'alipay_root_cert_path', label: '支付宝根证书路径', type: 'input', default: '', help: 'alipayRootCert.crt 绝对路径。' },
{ key: 'alipay_notify_help', label: '回调地址说明', type: 'notice', alertType: 'info', alertContent: '异步通知 / 同步返回已固定为 /wp-json/aksrt/v1/payment/alipay/{notify|return},无需在此填写。' },
],
},
{
key: 'paypal',
title: 'PayPal 配置',
icon: 'fab fa-paypal',
description: '开启「PayPal」后填写 Client 凭据。',
collapsible: true,
expandWhen: 'payment_paypal_enabled',
dependsOn: { key: 'payment_paypal_enabled', value: true },
fields: [
{ key: 'paypal_client_id', label: 'Client ID', type: 'input', default: '' },
{ key: 'paypal_client_secret', label: 'Client Secret', type: 'input', default: '' },
{ key: 'paypal_currency', label: '货币', type: 'input', default: 'USD' },
{ key: 'paypal_sandbox', label: '沙箱模式', type: 'switch', default: true },
],
},
{
key: 'stripe',
title: 'Stripe 配置',
icon: 'fab fa-stripe',
description: '开启「Stripe」后填写 API Key 与 Webhook。',
collapsible: true,
expandWhen: 'payment_stripe_enabled',
dependsOn: { key: 'payment_stripe_enabled', value: true },
fields: [
{ key: 'stripe_secret_key', label: 'Secret Key', type: 'input', default: '' },
{ key: 'stripe_publishable_key', label: 'Publishable Key', type: 'input', default: '' },
{ key: 'stripe_webhook_secret', label: 'Webhook Secret', type: 'input', default: '', help: 'Stripe Dashboard 配置 Webhook 后获得,用于验签。' },
{ key: 'stripe_currency', label: '货币', type: 'input', default: 'usd' },
{ key: 'stripe_test_mode', label: '测试模式', type: 'switch', default: true },
],
},
{
key: 'epay',
title: '易支付配置',
icon: 'fas fa-university',
description: '开启「易支付」后填写接口地址与商户信息,并选择支付宝/微信子通道。',
collapsible: true,
expandWhen: 'payment_epay_enabled',
dependsOn: { key: 'payment_epay_enabled', value: true },
fields: [
{ key: 'epay_apiurl', label: '接口地址', type: 'input', default: '', help: '易支付站点根地址,如 https://pay.example.com/(末尾斜杠可选)。' },
{ key: 'epay_pid', label: '商户ID', type: 'input', default: '' },
{ key: 'epay_key', label: '商户密钥', type: 'input', default: '', help: 'MD5 通信密钥。' },
{ key: 'epay_channel_alipay', label: '启用支付宝通道', type: 'switch', default: true },
{ key: 'epay_channel_wxpay', label: '启用微信通道', type: 'switch', default: true },
{ key: 'epay_device', label: '下单终端', type: 'select', default: 'auto', options: [
{ label: '自动(按 UA)', value: 'auto' },
{ label: '电脑端 submit', value: 'pc' },
{ label: '移动端 mapi', value: 'mobile' },
] },
{ key: 'epay_notify_help', label: '回调地址说明', type: 'notice', alertType: 'info', alertContent: '异步/同步回调固定为 /wp-json/aksrt/v1/payment/epay_alipay/{notify|return} 与 /payment/epay_wxpay/{notify|return},请在易支付后台放行对应 URL。' },
],
},
],
}