From 087e472dfae378a8594ee213eb950118046f7d17 Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Thu, 7 Nov 2024 10:36:34 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=B5=8B=E8=AF=95=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20144=EF=BC=9B=E5=9B=BE=E6=96=87=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=88=90=E5=8A=9F=E5=90=8E=E5=85=B3=E9=97=AD=EF=BC=9B?= =?UTF-8?q?=E5=87=BA=E9=94=99=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config.js | 2 +- src/stores/AuthStore.js | 2 +- src/views/accounts/SnippetList.jsx | 20 ++++++++++++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/config.js b/src/config.js index 3128562..6b282e1 100644 --- a/src/config.js +++ b/src/config.js @@ -6,7 +6,7 @@ // export const WS_URL = 'wss://p9axztuwd7x8a7.mycht.cn/whatsapp_144'; // prod: Slave // debug: -export const API_HOST = 'http://202.103.68.157:8889/v2'; +export const API_HOST = 'http://202.103.68.144:8889/v2'; export const WS_URL = 'ws://202.103.68.157:8889'; // prod: // export const API_HOST = 'https://p9axztuwd7x8a7.mycht.cn/whatsapp_server'; diff --git a/src/stores/AuthStore.js b/src/stores/AuthStore.js index eb2e528..87046dc 100644 --- a/src/stores/AuthStore.js +++ b/src/stores/AuthStore.js @@ -51,7 +51,7 @@ const useAuthStore = create(devtools((set, get) => ({ setLoginStatus(200) const json = await fetchJSON( - 'http://202.103.68.157:889/dingtalk/dingtalkwork/WhatsAppAuth', + 'http://202.103.68.144:889/dingtalk/dingtalkwork/WhatsAppAuth', //`https://p9axztuwd7x8a7.mycht.cn/dingtalk/dingtalkwork/WhatsAppAuth`, { authCode }, ) diff --git a/src/views/accounts/SnippetList.jsx b/src/views/accounts/SnippetList.jsx index d4690a4..4a9513a 100644 --- a/src/views/accounts/SnippetList.jsx +++ b/src/views/accounts/SnippetList.jsx @@ -1,4 +1,4 @@ -import { Row, Col, Tag, List, Form, Input, Button, Space, Modal, Select, message } from 'antd' +import { App, Row, Col, Tag, List, Form, Input, Button, Space, Modal, Select, message } from 'antd' import { useState, useEffect } from 'react' import EditorInput from '../../components/EditorInput' import HtmlPreview from './HtmlPreview' @@ -25,12 +25,28 @@ function SnippetList() { const [loginUser] = useAuthStore((state) => [state.loginUser]) + const { notification } = App.useApp() const [isSnippetModalOpen, setSnippetModalOpen] = useState(false) const [isHtmlLoading, setHtmlLoading] = useState(false) const onSnippetFinish = (values) => { - console.log('onSnippetFinish:', values) saveOrUpdateSnippet(values) + .then(() => { + notification.info({ + message: 'Notification', + description: '图文保存成功', + placement: 'top', + }) + setSnippetModalOpen(false) + }) + .catch(ex => { + notification.error({ + message: 'Notification', + description: ex.message, + placement: 'top', + duration: 4, + }) + }) } const onSnippetFailed = (error) => {