diff --git a/service/src/chatgpt/index.ts b/service/src/chatgpt/index.ts index 22665ff..f8f20a4 100644 --- a/service/src/chatgpt/index.ts +++ b/service/src/chatgpt/index.ts @@ -15,12 +15,13 @@ const { HttpsProxyAgent } = httpsProxyAgent dotenv.config() const ErrorCodeMessage: Record = { - 401: '[OpenAI] 提供错误的API密钥 | Incorrect API key provided', - 403: '[OpenAI] 服务器拒绝访问,请稍后再试 | Server refused to access, please try again later', - 502: '[OpenAI] 错误的网关 | Bad Gateway', - 503: '[OpenAI] 服务器繁忙,请稍后再试 | Server is busy, please try again later', - 504: '[OpenAI] 网关超时 | Gateway Time-out', - 500: '[OpenAI] 服务器繁忙,请稍后再试 | Internal Server Error', + 401: '[OpenAI] Đã cung cấp khóa API không chính xác', + 403: '[OpenAI] Máy chủ từ chối truy cập, vui lòng thử lại sau', + 502: '[OpenAI] Cổng xấu', + 503: '[OpenAI] Máy chủ đang bận, vui lòng thử lại sau', + 504: '[OpenAI] Hết thời gian yêu cầu', + 500: '[OpenAI] Lỗi máy chủ nội bộ', + 429: '[OpenAI] Máy chủ quá tải, hãy dùng luân phiên mentor.chatvn.org và chatgpt.chatvn.org hoặc chatgpt2.chatvn.org .Thông báo lý do quá tải: https://chatvn.org/page/thong-bao-ve-tinh-trang-may-chu-va-ngan-sach-cho-chatvn-org/', } const timeoutMs: number = !isNaN(+process.env.TIMEOUT_MS) ? +process.env.TIMEOUT_MS : 100 * 1000 @@ -78,6 +79,7 @@ let api: ChatGPTAPI | ChatGPTUnofficialProxyAPI apiModel = 'ChatGPTAPI' } else { + console.log('OPENAI_ACCESS_TOKEN',OPENAI_ACCESS_TOKEN); const options: ChatGPTUnofficialProxyAPIOptions = { accessToken: process.env.OPENAI_ACCESS_TOKEN, apiReverseProxyUrl: isNotEmptyString(process.env.API_REVERSE_PROXY) ? process.env.API_REVERSE_PROXY : 'https://ai.fakeopen.com/api/conversation', diff --git a/service/src/middleware/limiter.ts b/service/src/middleware/limiter.ts index 0da0311..7a70a56 100644 --- a/service/src/middleware/limiter.ts +++ b/service/src/middleware/limiter.ts @@ -12,7 +12,7 @@ const limiter = rateLimit({ max: maxCount, statusCode: 200, // 200 means success,but the message is 'Too many request from this IP in 1 hour' message: async (req, res) => { - res.send({ status: 'Fail', message: 'Too many request from this IP in 1 hour', data: null }) + res.send({ status: 'Fail', message: 'Giới hạn trò chuyện trong 1h, bạn hãy sử dụng https://mentor.chatvn.org để chat không giới hạn.', data: null }) }, }) diff --git a/src/assets/recommend.json b/src/assets/recommend.json index 80c7ae4..ba29c32 100644 --- a/src/assets/recommend.json +++ b/src/assets/recommend.json @@ -2,7 +2,7 @@ { "key": "chatgpt-prompt-collection", "desc": "Prompt được thu thập bởi Nothing1024", - "downloadUrl": "https://chatgptvietnam.org/chatgpt/awesome-chatgpt-prompts-vi.php", + "downloadUrl": "https://chatvn.org/chatgpt/awesome-chatgpt-prompts-vi.php", "url": "https://github.com/bcat95/chatgpt-prompt-collection" } ] diff --git a/src/hooks/useLanguage.ts b/src/hooks/useLanguage.ts index e7cc7c7..78fa659 100644 --- a/src/hooks/useLanguage.ts +++ b/src/hooks/useLanguage.ts @@ -1,5 +1,5 @@ import { computed } from 'vue' -import { viVN, enUS, zhCN, zhTW } from 'naive-ui' +import { viVN, enUS } from 'naive-ui' import { useAppStore } from '@/store' import { setLocale } from '@/locales' @@ -14,15 +14,9 @@ export function useLanguage() { case 'en-US': setLocale('en-US') return enUS - case 'zh-CN': - setLocale('zh-CN') - return zhCN - case 'zh-TW': - setLocale('zh-TW') - return zhTW default: - setLocale('en-US') - return enUS + setLocale('vi-VN') + return viVN } }) diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 0654dd3..af70875 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -26,6 +26,7 @@ export default { failed: 'Failed', verify: 'Verify', unauthorizedTips: 'Unauthorized, please verify first.', + stopResponding: 'Stop Responding', }, chat: { newChatButton: 'New Chat', @@ -74,6 +75,7 @@ export default { monthlyUsage: 'Monthly Usage', }, store: { + siderButton: 'Prompt Store', local: 'Local', online: 'Online', title: 'Title', diff --git a/src/locales/index.ts b/src/locales/index.ts index 13b0ed5..6ac82d6 100644 --- a/src/locales/index.ts +++ b/src/locales/index.ts @@ -18,7 +18,7 @@ const i18n = createI18n({ messages: { 'vi-VN': viVN, 'en-US': enUS, - 'zh-CN': zhCN, + 'zh-CN': zhCN, 'zh-TW': zhTW, }, }) diff --git a/src/locales/vi-VN.ts b/src/locales/vi-VN.ts index e853e11..99d0bfc 100644 --- a/src/locales/vi-VN.ts +++ b/src/locales/vi-VN.ts @@ -74,6 +74,7 @@ export default { monthlyUsage: 'Sử dụng hàng tháng', }, store: { + siderButton: 'Thư viện Prompt', local: 'Địa phương', online: 'Trực tuyến', title: 'Tiêu đề', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 764dbce..4cd6659 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -26,6 +26,7 @@ export default { failed: '操作失败', verify: '验证', unauthorizedTips: '未经授权,请先进行验证。', + stopResponding: '停止响应', }, chat: { newChatButton: '新建聊天', @@ -74,6 +75,7 @@ export default { monthlyUsage: '本月使用量', }, store: { + siderButton: '提示词商店', local: '本地', online: '在线', title: '标题', @@ -90,4 +92,4 @@ export default { onlineImportWarning: '注意:请检查 JSON 文件来源!', downloadError: '请检查网络状态与 JSON 文件有效性', }, -} \ No newline at end of file +} diff --git a/src/locales/zh-TW.ts b/src/locales/zh-TW.ts index 65725f4..ddc35af 100644 --- a/src/locales/zh-TW.ts +++ b/src/locales/zh-TW.ts @@ -26,9 +26,10 @@ export default { failed: '操作失敗', verify: '驗證', unauthorizedTips: '未經授權,請先進行驗證。', + stopResponding: '停止回應', }, chat: { - newChatButton: '新建對話', + newChatButton: '新增對話', placeholder: '來說點什麼...(Shift + Enter = 換行,"/" 觸發提示詞)', placeholderMobile: '來說點什麼...', copy: '複製', @@ -53,7 +54,7 @@ export default { setting: { setting: '設定', general: '總覽', - advanced: '高級', + advanced: '進階', config: '設定', avatarLink: '頭貼連結', name: '名稱', @@ -70,10 +71,11 @@ export default { timeout: '逾時', socks: 'Socks', httpsProxy: 'HTTPS Proxy', - balance: 'API余額', + balance: 'API Credit 餘額', monthlyUsage: '本月使用量', }, store: { + siderButton: '提示詞商店', local: '本機', online: '線上', title: '標題', @@ -90,4 +92,4 @@ export default { onlineImportWarning: '注意:請檢查 JSON 檔案來源!', downloadError: '請檢查網路狀態與 JSON 檔案有效性', }, -} \ No newline at end of file +} diff --git a/src/store/modules/user/helper.ts b/src/store/modules/user/helper.ts index a5ad6a4..66f7336 100644 --- a/src/store/modules/user/helper.ts +++ b/src/store/modules/user/helper.ts @@ -15,9 +15,9 @@ export interface UserState { export function defaultSetting(): UserState { return { userInfo: { - avatar: 'https://chatgptvietnam.org/assets/favicon.png', - name: 'chatgptvietnam.org', - description: 'Trải nghiệm ngay ChatGPT Vietnamese không cần tài khoản', + avatar: 'https://chatvn.org/assets/favicon.png', + name: 'chatvn.org', + description: 'Trải nghiệm ngay Chat GPT không cần tài khoản', }, } }