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) => {