support add pay form url env (#6086)

* support add pay form url env

* optimize

* fix
This commit is contained in:
heheer 2025-12-17 17:28:40 +08:00 committed by GitHub
parent 285e2b5c93
commit abc2b6d20d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 22 additions and 6 deletions

View File

@ -128,6 +128,7 @@ export type FastGPTFeConfigsType = {
alipay?: boolean;
bank?: boolean;
};
payFormUrl?: string;
fileUrlWhitelist?: string[];
customDomain?: {
enable?: boolean;

View File

@ -996,6 +996,7 @@
"pay.package_tip.buy": "The package you purchased is lower than the current package. This package will take effect after the current package expires.\nYou can view the package usage in Account - Personal Information - Package Details.",
"pay.package_tip.renewal": "You are renewing the package. You can view the package usage in Account - Personal Information - Package Details.",
"pay.package_tip.upgrade": "The package you purchased is higher than the current package. This package will take effect immediately, and the current package will take effect later. You can view the package usage in Account - Personal Information - Package Details.",
"pay.payment_form_tip": "For more payment methods, please <payLink>click the form </payLink>",
"pay.wechat": "Please scan the QR code on WeChat to pay: {{price}} yuan\n\nPlease do not close the page before payment is completed",
"pay.wx_payment": "WeChat Payment",
"pay.yuan": "{{amount}} Yuan",

View File

@ -1003,6 +1003,7 @@
"pay.package_tip.buy": "您购买的套餐等级低于当前套餐,该套餐将在当前套餐过期后生效。\n您可在账号—个人信息—套餐详情里查看套餐使用情况。",
"pay.package_tip.renewal": "您正在续费套餐。您可在账号—个人信息—套餐详情里,查看套餐使用情况。",
"pay.package_tip.upgrade": "您购买的套餐等级高于当前套餐,该套餐将即刻生效,当前套餐将延后生效。您可在账号—个人信息—套餐详情里,查看套餐使用情况。",
"pay.payment_form_tip": "更多支付方式,请<payLink>点击表单</payLink>",
"pay.wechat": "请微信扫码支付: {{price}}元\n支付完成前请勿关闭页面",
"pay.wx_payment": "微信支付",
"pay.yuan": "{{amount}}元",

View File

@ -993,6 +993,7 @@
"pay.package_tip.buy": "您購買的方案等級低於目前方案,該方案將在目前方案過期後生效。\n您可在帳戶 - 個人資訊 - 方案詳細資訊中檢視方案使用情況。",
"pay.package_tip.renewal": "您正在續約方案。您可在帳戶 - 個人資訊 - 方案詳細資訊中檢視方案使用情況。",
"pay.package_tip.upgrade": "您購買的方案等級高於目前方案,該方案將立即生效,目前方案將延後生效。您可在帳戶 - 個人資訊 - 方案詳細資訊中檢視方案使用情況。",
"pay.payment_form_tip": "更多支付方式,請<payLink>點擊表單</payLink>",
"pay.wechat": "請微信掃碼付款:{{price}}元\n\n付款完成前請勿關閉頁面",
"pay.wx_payment": "微信支付",
"pay.yuan": "{{amount}} 元",

View File

@ -1,7 +1,7 @@
import MyModal from '@fastgpt/web/components/common/MyModal';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'next-i18next';
import { Box, ModalBody, Flex, Button } from '@chakra-ui/react';
import { useTranslation, Trans } from 'next-i18next';
import { Box, ModalBody, Flex, Button, Text, Link } from '@chakra-ui/react';
import { checkBalancePayResult, putUpdatePayment } from '@/web/support/wallet/bill/api';
import LightTip from '@fastgpt/web/components/common/LightTip';
import QRCode from 'qrcode';
@ -241,6 +241,17 @@ const QRCodePayModal = ({
</Button>
)}
</Flex>
{feConfigs.payFormUrl && (
<Box mt={4} textAlign="center" fontSize="sm">
<Trans
i18nKey="common:pay.payment_form_tip"
components={{
payLink: <Link href={feConfigs.payFormUrl} target="_blank" color="primary.600" />
}}
/>
</Box>
)}
</ModalBody>
</MyModal>
);

View File

@ -105,7 +105,7 @@ const TemplateImportModal = ({
FileTypeNode={
<Box fontSize={'xs'}>
<Trans
i18nKey={'file:template_csv_file_select_tip'}
i18nKey="file:template_csv_file_select_tip"
values={{
fileType: '.csv'
}}

View File

@ -19,7 +19,7 @@ const PolicyTip = ({ isCenter }: { isCenter: boolean }) => {
whiteSpace={'pre-wrap'}
>
<Trans
i18nKey={'login:policy_tip'}
i18nKey="login:policy_tip"
components={{
div: <Flex justifyContent={'center'} />,
termsLink: (

View File

@ -260,7 +260,7 @@ const EvaluationCreating = () => {
FileTypeNode={
<Box fontSize={'xs'}>
<Trans
i18nKey={'dashboard_evaluation:template_csv_file_select_tip'}
i18nKey="dashboard_evaluation:template_csv_file_select_tip"
values={{
fileType: '.csv'
}}

View File

@ -150,7 +150,8 @@ export async function initSystemConfig() {
show_coupon: process.env.SHOW_COUPON === 'true',
show_discount_coupon: process.env.SHOW_DISCOUNT_COUPON === 'true',
show_dataset_enhance: licenseData?.functions?.datasetEnhance,
show_batch_eval: licenseData?.functions?.batchEval
show_batch_eval: licenseData?.functions?.batchEval,
payFormUrl: process.env.PAY_FORM_URL || ''
},
systemEnv: {
...fileRes.systemEnv,