From e7a2459c969846bce3039ee7f8b48c8a898e47a4 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 01:19:09 +0000 Subject: [PATCH] style: format code with Prettier and StandardJS This commit fixes the style issues introduced in 357cfc5 according to the output from Prettier and StandardJS. Details: None --- src/pages/crypto/index.jsx | 3 +- src/pages/layout/proSecNav/index.jsx | 24 +++++------ src/pages/video/index.jsx | 6 +-- src/routers/authRouter.jsx | 6 +-- src/routers/index.jsx | 60 ++++++++++++++-------------- 5 files changed, 50 insertions(+), 49 deletions(-) diff --git a/src/pages/crypto/index.jsx b/src/pages/crypto/index.jsx index 17a9d925..0a630006 100644 --- a/src/pages/crypto/index.jsx +++ b/src/pages/crypto/index.jsx @@ -69,7 +69,8 @@ v4U73TKOI+a1xxr6ZMQ4vzwt encrypt.setPublicKey(publicKey) // const reaParameter = CryptoJS.lib.WordArray.random(80 / 4).toString() - const reaParameter = `基于转换器的大型神经网络可以有数十亿个参数。模型的大小通常由模型大小、参数数量和训练数据规模之间的经验关系决定。` + const reaParameter = + '基于转换器的大型神经网络可以有数十亿个参数。模型的大小通常由模型大小、参数数量和训练数据规模之间的经验关系决定。' const reaEncrypt = encrypt.encrypt(reaParameter) setReaData(reaParameter) diff --git a/src/pages/layout/proSecNav/index.jsx b/src/pages/layout/proSecNav/index.jsx index b9e4625b..797b9074 100644 --- a/src/pages/layout/proSecNav/index.jsx +++ b/src/pages/layout/proSecNav/index.jsx @@ -9,7 +9,7 @@ import { QuestionCircleOutlined, FireOutlined, GlobalOutlined, - QrcodeOutlined, + QrcodeOutlined } from '@ant-design/icons' import styles from './index.module.less' @@ -18,7 +18,7 @@ const pathSubmenu = { '/home': ['home'], '/coupons/add': ['/sub-act', '/sub-coupons'], '/coupons/edit': ['/sub-act', '/sub-coupons'], - '/product': ['/sub-act', '/sub-coupons'], + '/product': ['/sub-act', '/sub-coupons'] } const ProSecNav = () => { @@ -86,11 +86,11 @@ const ProSecNav = () => { icon: , children: [ { label: 'Vue', key: '/coupons/add' }, - { label: 'Angular', key: '/coupons/edit' }, - ], + { label: 'Angular', key: '/coupons/edit' } + ] }, - { label: '后端技术栈', key: '/product', icon: }, - ], + { label: '后端技术栈', key: '/product', icon: } + ] }, { label: '构建工具', @@ -98,26 +98,26 @@ const ProSecNav = () => { icon: , children: [ { label: 'Webpack', key: '/coupons/list' }, - { label: 'Vite', key: '/order/list' }, - ], + { label: 'Vite', key: '/order/list' } + ] }, { label: 'Error', key: '/sub-error', icon: , - children: [{ label: 'ErrorBoundary', key: '/error' }], - }, + children: [{ label: 'ErrorBoundary', key: '/error' }] + } ] return ( <> { sources: [ { src: 'https://placehold.co/1920x1080.mp4', - type: 'video/mp4', - }, - ], + type: 'video/mp4' + } + ] } const handlePlayerReady = (player) => { diff --git a/src/routers/authRouter.jsx b/src/routers/authRouter.jsx index 2232c506..eedc8d99 100644 --- a/src/routers/authRouter.jsx +++ b/src/routers/authRouter.jsx @@ -9,7 +9,7 @@ const AuthRouter = (props) => { if (!route?.auth) return props.children const { token } = getLocalStorage('token') || { token: null } - if (!token) return + if (!token) return // * 后端返回有权限路由列表 暂时硬编码 需要结合 proSecNav组件中的menuItems const routerList = [ @@ -23,9 +23,9 @@ const AuthRouter = (props) => { '/three', '/echarts', '/video', - '/crypto', + '/crypto' ] - if (routerList.indexOf(pathname) === -1) return + if (routerList.indexOf(pathname) === -1) return return props.children } diff --git a/src/routers/index.jsx b/src/routers/index.jsx index b30ad61c..57217cd6 100644 --- a/src/routers/index.jsx +++ b/src/routers/index.jsx @@ -50,7 +50,7 @@ const rootRouter = [ name: '首页', key: '/', auth: true, - element: lazyLoad(Home), + element: lazyLoad(Home) }, { index: false, @@ -58,7 +58,7 @@ const rootRouter = [ name: 'Demo', key: '/demo', auth: true, - element: lazyLoad(Demo), + element: lazyLoad(Demo) }, { index: false, @@ -66,7 +66,7 @@ const rootRouter = [ name: 'Parallax', key: '/parallax', auth: true, - element: lazyLoad(ParallaxVert), + element: lazyLoad(ParallaxVert) }, { index: false, @@ -74,7 +74,7 @@ const rootRouter = [ name: 'QrGenerate', key: '/qrcode', auth: true, - element: lazyLoad(QrCode), + element: lazyLoad(QrCode) }, { index: false, @@ -82,7 +82,7 @@ const rootRouter = [ name: 'React Tilt', key: '/tilt', auth: true, - element: lazyLoad(ReactTilt), + element: lazyLoad(ReactTilt) }, { index: false, @@ -90,7 +90,7 @@ const rootRouter = [ name: 'React Music', key: '/music', auth: false, - element: lazyLoad(ReactMusic), + element: lazyLoad(ReactMusic) }, { index: false, @@ -98,7 +98,7 @@ const rootRouter = [ name: 'React Video', key: '/video', auth: false, - element: lazyLoad(MyVideo), + element: lazyLoad(MyVideo) }, { index: false, @@ -106,7 +106,7 @@ const rootRouter = [ name: 'React Crypto', key: '/crypto', auth: false, - element: lazyLoad(MyCrypto), + element: lazyLoad(MyCrypto) }, { index: false, @@ -114,7 +114,7 @@ const rootRouter = [ name: 'ChatGPT Markmap', key: '/markmap', auth: false, - element: lazyLoad(ChatGpt), + element: lazyLoad(ChatGpt) }, { index: false, @@ -122,7 +122,7 @@ const rootRouter = [ name: 'ChatGPT Mermaid', key: '/mermaid', auth: false, - element: lazyLoad(Mermaid), + element: lazyLoad(Mermaid) }, { index: false, @@ -130,7 +130,7 @@ const rootRouter = [ name: 'PrismRender', key: '/prism', auth: true, - element: lazyLoad(PrismRender), + element: lazyLoad(PrismRender) }, { index: false, @@ -138,7 +138,7 @@ const rootRouter = [ name: 'ReactThree', key: '/three', auth: true, - element: lazyLoad(ReactThree), + element: lazyLoad(ReactThree) }, { index: false, @@ -146,7 +146,7 @@ const rootRouter = [ name: 'ReactEcharts', key: '/echarts', auth: true, - element: lazyLoad(Echarts), + element: lazyLoad(Echarts) }, { index: false, @@ -162,7 +162,7 @@ const rootRouter = [ name: 'React', key: '/coupons/home', auth: false, - element: lazyLoad(CouponsHome), + element: lazyLoad(CouponsHome) }, { index: false, @@ -170,7 +170,7 @@ const rootRouter = [ path: 'add', key: '/coupons/add', auth: false, - element: lazyLoad(CouponsAdd), + element: lazyLoad(CouponsAdd) }, { index: false, @@ -178,7 +178,7 @@ const rootRouter = [ name: 'Angular', key: '/coupons/edit', auth: false, - element: lazyLoad(CouponsEdit), + element: lazyLoad(CouponsEdit) }, { index: false, @@ -186,9 +186,9 @@ const rootRouter = [ name: 'Node', key: '/coupons/detail', auth: false, - element: lazyLoad(CouponsDetail), - }, - ], + element: lazyLoad(CouponsDetail) + } + ] }, { index: false, @@ -196,7 +196,7 @@ const rootRouter = [ name: '后端技术栈', key: '/product', auth: false, - element: lazyLoad(Product), + element: lazyLoad(Product) }, { index: false, @@ -204,15 +204,15 @@ const rootRouter = [ name: 'Error', key: '/error', auth: false, - element: lazyLoad(ErrorPage), + element: lazyLoad(ErrorPage) }, { path: '*', name: 'No Match', key: '*', - element: lazyLoad(NoMatch), - }, - ], + element: lazyLoad(NoMatch) + } + ] }, { index: false, @@ -220,7 +220,7 @@ const rootRouter = [ name: '登录', key: '/signin', auth: false, - element: lazyLoad(SignIn), + element: lazyLoad(SignIn) }, { index: false, @@ -228,7 +228,7 @@ const rootRouter = [ name: '注册', key: '/signup', auth: false, - element: lazyLoad(SignUp), + element: lazyLoad(SignUp) }, { index: false, @@ -236,7 +236,7 @@ const rootRouter = [ name: 'Dashboard', key: '/dashboard', auth: true, - element: lazyLoad(Dashboard), + element: lazyLoad(Dashboard) }, { index: false, @@ -244,14 +244,14 @@ const rootRouter = [ name: '403', key: '/403', auth: false, - element: lazyLoad(Exception403), + element: lazyLoad(Exception403) }, { path: '*', name: 'No Match', key: '*', - element: lazyLoad(NoMatch), - }, + element: lazyLoad(NoMatch) + } ] export default rootRouter