From 45341b49da664710a79dc9018c9b6771dc8298f1 Mon Sep 17 00:00:00 2001 From: yinglj Date: Mon, 1 Apr 2024 08:31:03 +0800 Subject: [PATCH 01/15] delete PORTAL_WEBSITE_URL --- api/server/routes/ask/openAI.js | 3 +-- api/server/routes/config.js | 1 - packages/data-provider/src/types.ts | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/api/server/routes/ask/openAI.js b/api/server/routes/ask/openAI.js index 4c55ad3d072..98de7ca5cb8 100644 --- a/api/server/routes/ask/openAI.js +++ b/api/server/routes/ask/openAI.js @@ -128,10 +128,9 @@ router.post('/', validateEndpoint, buildEndpointOption, setHeaders, async (req, ], }); let dailyQuota = quota[endpointOption.modelOptions.model].toFixed(0); - let portalWebsiteURL = process.env.PORTAL_WEBSITE_URL; if (messagesCount >= dailyQuota) { throw new Error( - `超出了您的使用额度(${endpointOption.modelOptions.model}模型每天${dailyQuota}条消息)。由于需要支付越来越多、每月上万元的API费用,如果您经常使用我们的服务,请打开“我的主页”进行购买,支持我们持续提供GPT服务。更多优惠套餐,请前往网站订购:${portalWebsiteURL}`, + `超出了您的使用额度(${endpointOption.modelOptions.model}模型每天${dailyQuota}条消息)。由于需要支付越来越多、每月上万元的API费用,如果您经常使用我们的服务,请打开“我的主页”进行购买,支持我们持续提供GPT服务。}`, ); } } diff --git a/api/server/routes/config.js b/api/server/routes/config.js index 2823954214d..cc2b6c7e113 100644 --- a/api/server/routes/config.js +++ b/api/server/routes/config.js @@ -22,7 +22,6 @@ router.get('/', async function (req, res) { registrationEnabled: isEnabled(process.env.ALLOW_REGISTRATION), socialLoginEnabled: isEnabled(process.env.ALLOW_SOCIAL_LOGIN), proMemberPaymentURL: process.env.PRO_MEMBER_PAYMENT_URL, - portalWebsiteURL: process.env.PORTAL_WEBSITE_URL, emailEnabled: (!!process.env.EMAIL_SERVICE || !!process.env.EMAIL_HOST) && !!process.env.EMAIL_USERNAME && diff --git a/packages/data-provider/src/types.ts b/packages/data-provider/src/types.ts index 5eede8302aa..fd6c174e7da 100644 --- a/packages/data-provider/src/types.ts +++ b/packages/data-provider/src/types.ts @@ -192,7 +192,6 @@ export type TStartupConfig = { checkBalance: boolean; customFooter?: string; proMemberPaymentURL: string; - portalWebsiteURL: string; }; export type TRefreshTokenResponse = { From e7a9df0762534226fda1ddc05d12d4682fd24562 Mon Sep 17 00:00:00 2001 From: yinglj Date: Mon, 1 Apr 2024 10:28:12 +0800 Subject: [PATCH 02/15] Further Improvement of Payment via Stripe, without WordPress and Flexible Branding #185 --- client/src/components/Profile/index.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/client/src/components/Profile/index.tsx b/client/src/components/Profile/index.tsx index 3bb24024c5c..668533cf704 100644 --- a/client/src/components/Profile/index.tsx +++ b/client/src/components/Profile/index.tsx @@ -39,6 +39,8 @@ function ProfileContent() { const { userId = '' } = useParams(); const { user, token } = useAuthContext(); const localize = useLocalize(); + let lang = localStorage.getItem('lang'); + lang = lang ? lang.substring(0, 2) : 'en'; const navigate = useNavigate(); useDocumentTitle('Profile'); @@ -469,7 +471,11 @@ function ProfileContent() { @@ -482,7 +488,11 @@ function ProfileContent() { From 254da796ef701bbd66f8b61ad21ca88b5716a03c Mon Sep 17 00:00:00 2001 From: yinglj Date: Tue, 2 Apr 2024 08:09:34 +0800 Subject: [PATCH 03/15] add some spacing between free and pro button --- client/src/components/Profile/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/Profile/index.tsx b/client/src/components/Profile/index.tsx index 668533cf704..3e629937e61 100644 --- a/client/src/components/Profile/index.tsx +++ b/client/src/components/Profile/index.tsx @@ -470,7 +470,7 @@ function ProfileContent() { {proMemberExpiredAt.getMonth() + 1}-{proMemberExpiredAt.getDate()}