From e22958b01d5f0ab7146e33da1eba7562cf2f1aa7 Mon Sep 17 00:00:00 2001 From: weaigc <879821485@qq.com> Date: Tue, 12 Sep 2023 18:19:22 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/components/chat-notification.tsx | 4 +-- src/components/settings.tsx | 37 ++++++++++++++-------------- src/lib/utils.ts | 11 +++++++-- 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 5e2b8dae..cad14ce4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bingo", - "version": "0.6.3", + "version": "0.6.4", "private": true, "scripts": { "dev": "cross-env DEBUG=bingo* next dev --hostname 0.0.0.0", diff --git a/src/components/chat-notification.tsx b/src/components/chat-notification.tsx index f256a6f2..505bcdf4 100644 --- a/src/components/chat-notification.tsx +++ b/src/components/chat-notification.tsx @@ -13,7 +13,7 @@ function getAction(error: ChatError, reset: () => void) { reset() return (
- 你已达到每日最大发送消息次数,请更换账号或隔一天后重试 + 请求次数过快,已被限流,请稍候重试...
) } @@ -41,7 +41,7 @@ function getAction(error: ChatError, reset: () => void) { if (error.code === ErrorCode.CONVERSATION_LIMIT) { return (
- 当前话题已中止,请点 + 当前话题已中止,请点击 重新开始 开启新的对话
diff --git a/src/components/settings.tsx b/src/components/settings.tsx index eb4eefee..d0e7d6bd 100644 --- a/src/components/settings.tsx +++ b/src/components/settings.tsx @@ -41,8 +41,9 @@ export function Settings() { toast.error('用户信息格式不正确') return } - if (RegExp.$1 === 'cn' && checked === false) { - toast.error('你配置的中文域名 cn.bing.com 仅支持画图') + if (RegExp.$1 === 'cn') { + toast.error('你配置的国内域名 cn.bing.com 仅支持画图') + setImageOnly(true) return } setImageOnly(checked) @@ -80,7 +81,9 @@ export function Settings() { placeholder="在此填写用户信息,格式: curl 'https://www.bing.com/turing/captcha/challenge' ..." onChange={e => { setCurlValue(e.target.value) - setImageOnly(!Boolean(e.target.value)) + if (!/^\s*curl ['"]https:\/\/www\.bing\.com\/turing\/captcha\/challenge['"]/.test(e.target.value)) { + setImageOnly(true) + } }} />
@@ -93,23 +96,21 @@ export function Settings() { className={`${imageOnly ? 'translate-x-6' : 'translate-x-1'} inline-block h-4 w-4 transform rounded-full bg-white transition`} /> - 用户信息仅用于画图(账号异常时使用) + 尝试修复用户信息异常
- {!imageOnly && ( -
- setHistory(checked)} - > - - - 启用历史记录 -
- )} +
+ setHistory(checked)} + > + + + 启用历史记录 +