From 46711796142e03b398a0ed22c012f1f18803f48e Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Thu, 5 Sep 2024 16:08:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E4=B8=8A=E4=BC=A0Pag?= =?UTF-8?q?eSpy=E7=A6=BB=E7=BA=BF=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/App.jsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/views/App.jsx b/src/views/App.jsx index cab3e4a..69b558e 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -1,6 +1,6 @@ import { Outlet, Link, useHref, useNavigate, NavLink } from 'react-router-dom' import { useEffect, useState } from 'react' -import { Layout, Menu, ConfigProvider, theme, Dropdown, Space, Row, Col, Badge, App as AntApp } from 'antd' +import { Layout, Menu, ConfigProvider, theme, Dropdown, FloatButton, Space, Row, Col, Badge, App as AntApp } from 'antd' import { DownOutlined } from '@ant-design/icons' import 'antd/dist/reset.css' import AppLogo from '@/assets/logo-gh.png' @@ -9,6 +9,7 @@ import { useTranslation } from 'react-i18next' import zhLocale from 'antd/locale/zh_CN' import enLocale from 'antd/locale/en_US' import 'dayjs/locale/zh-cn' +import { BugOutlined } from "@ant-design/icons" import ErrorBoundary from '@/components/ErrorBoundary' import { BUILD_VERSION, } from '@/config' import useNoticeStore from '@/stores/Notice' @@ -33,6 +34,8 @@ function App() { const { loginToken } = usingStorage() + const { message, notification } = AntApp.useApp() + const noticeUnRead = useNoticeStore((state) => state.noticeUnRead) const href = useHref() const navigate = useNavigate() @@ -59,6 +62,15 @@ function App() { appendRequestParams('lgc', language) }, [i18n.language]) + const uploadLog = () => { + if (window.$pageSpy) { + window.$pageSpy.triggerPlugins('onOfflineLog', 'upload') + alert('Success.') + } else { + alert('Failure.') + } + } + return ( + } onClick={() => uploadLog()} />