Skip to content

Commit

Permalink
style: format code with Prettier and StandardJS
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in 357cfc5 according to the output
from Prettier and StandardJS.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored Nov 6, 2023
1 parent 357cfc5 commit e7a2459
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 49 deletions.
3 changes: 2 additions & 1 deletion src/pages/crypto/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
24 changes: 12 additions & 12 deletions src/pages/layout/proSecNav/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
QuestionCircleOutlined,
FireOutlined,
GlobalOutlined,
QrcodeOutlined,
QrcodeOutlined
} from '@ant-design/icons'

import styles from './index.module.less'
Expand All @@ -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 = () => {
Expand Down Expand Up @@ -86,38 +86,38 @@ const ProSecNav = () => {
icon: <FireOutlined />,
children: [
{ label: 'Vue', key: '/coupons/add' },
{ label: 'Angular', key: '/coupons/edit' },
],
{ label: 'Angular', key: '/coupons/edit' }
]
},
{ label: '后端技术栈', key: '/product', icon: <DeploymentUnitOutlined /> },
],
{ label: '后端技术栈', key: '/product', icon: <DeploymentUnitOutlined /> }
]
},
{
label: '构建工具',
key: '/sub-list',
icon: <ApartmentOutlined />,
children: [
{ label: 'Webpack', key: '/coupons/list' },
{ label: 'Vite', key: '/order/list' },
],
{ label: 'Vite', key: '/order/list' }
]
},
{
label: 'Error',
key: '/sub-error',
icon: <QuestionCircleOutlined />,
children: [{ label: 'ErrorBoundary', key: '/error' }],
},
children: [{ label: 'ErrorBoundary', key: '/error' }]
}
]

return (
<>
<Menu
mode="inline"
mode='inline'
defaultSelectedKeys={selectedKeys}
defaultOpenKeys={openKeys}
selectedKeys={selectedKeys}
openKeys={openKeys}
theme="light"
theme='light'
className={styles.menu}
onOpenChange={onOpenChange}
onSelect={onSelect}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/video/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ const MyVideo = () => {
sources: [
{
src: 'https://placehold.co/1920x1080.mp4',
type: 'video/mp4',
},
],
type: 'video/mp4'
}
]
}

const handlePlayerReady = (player) => {
Expand Down
6 changes: 3 additions & 3 deletions src/routers/authRouter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const AuthRouter = (props) => {
if (!route?.auth) return props.children

const { token } = getLocalStorage('token') || { token: null }
if (!token) return <Navigate to="/signin" replace />
if (!token) return <Navigate to='/signin' replace />

// * 后端返回有权限路由列表 暂时硬编码 需要结合 proSecNav组件中的menuItems
const routerList = [
Expand All @@ -23,9 +23,9 @@ const AuthRouter = (props) => {
'/three',
'/echarts',
'/video',
'/crypto',
'/crypto'
]
if (routerList.indexOf(pathname) === -1) return <Navigate to="/403" replace />
if (routerList.indexOf(pathname) === -1) return <Navigate to='/403' replace />

return props.children
}
Expand Down
60 changes: 30 additions & 30 deletions src/routers/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,103 +50,103 @@ const rootRouter = [
name: '首页',
key: '/',
auth: true,
element: lazyLoad(Home),
element: lazyLoad(Home)
},
{
index: false,
path: 'demo',
name: 'Demo',
key: '/demo',
auth: true,
element: lazyLoad(Demo),
element: lazyLoad(Demo)
},
{
index: false,
path: 'parallax',
name: 'Parallax',
key: '/parallax',
auth: true,
element: lazyLoad(ParallaxVert),
element: lazyLoad(ParallaxVert)
},
{
index: false,
path: 'qrcode',
name: 'QrGenerate',
key: '/qrcode',
auth: true,
element: lazyLoad(QrCode),
element: lazyLoad(QrCode)
},
{
index: false,
path: 'tilt',
name: 'React Tilt',
key: '/tilt',
auth: true,
element: lazyLoad(ReactTilt),
element: lazyLoad(ReactTilt)
},
{
index: false,
path: 'music',
name: 'React Music',
key: '/music',
auth: false,
element: lazyLoad(ReactMusic),
element: lazyLoad(ReactMusic)
},
{
index: false,
path: 'video',
name: 'React Video',
key: '/video',
auth: false,
element: lazyLoad(MyVideo),
element: lazyLoad(MyVideo)
},
{
index: false,
path: 'crypto',
name: 'React Crypto',
key: '/crypto',
auth: false,
element: lazyLoad(MyCrypto),
element: lazyLoad(MyCrypto)
},
{
index: false,
path: 'markmap',
name: 'ChatGPT Markmap',
key: '/markmap',
auth: false,
element: lazyLoad(ChatGpt),
element: lazyLoad(ChatGpt)
},
{
index: false,
path: 'mermaid',
name: 'ChatGPT Mermaid',
key: '/mermaid',
auth: false,
element: lazyLoad(Mermaid),
element: lazyLoad(Mermaid)
},
{
index: false,
path: 'prism',
name: 'PrismRender',
key: '/prism',
auth: true,
element: lazyLoad(PrismRender),
element: lazyLoad(PrismRender)
},
{
index: false,
path: 'three',
name: 'ReactThree',
key: '/three',
auth: true,
element: lazyLoad(ReactThree),
element: lazyLoad(ReactThree)
},
{
index: false,
path: 'echarts',
name: 'ReactEcharts',
key: '/echarts',
auth: true,
element: lazyLoad(Echarts),
element: lazyLoad(Echarts)
},
{
index: false,
Expand All @@ -162,96 +162,96 @@ const rootRouter = [
name: 'React',
key: '/coupons/home',
auth: false,
element: lazyLoad(CouponsHome),
element: lazyLoad(CouponsHome)
},
{
index: false,
name: 'Vue',
path: 'add',
key: '/coupons/add',
auth: false,
element: lazyLoad(CouponsAdd),
element: lazyLoad(CouponsAdd)
},
{
index: false,
path: 'edit',
name: 'Angular',
key: '/coupons/edit',
auth: false,
element: lazyLoad(CouponsEdit),
element: lazyLoad(CouponsEdit)
},
{
index: false,
path: 'detail',
name: 'Node',
key: '/coupons/detail',
auth: false,
element: lazyLoad(CouponsDetail),
},
],
element: lazyLoad(CouponsDetail)
}
]
},
{
index: false,
path: 'product',
name: '后端技术栈',
key: '/product',
auth: false,
element: lazyLoad(Product),
element: lazyLoad(Product)
},
{
index: false,
path: 'error',
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,
path: 'signin',
name: '登录',
key: '/signin',
auth: false,
element: lazyLoad(SignIn),
element: lazyLoad(SignIn)
},
{
index: false,
path: 'signup',
name: '注册',
key: '/signup',
auth: false,
element: lazyLoad(SignUp),
element: lazyLoad(SignUp)
},
{
index: false,
path: 'dashboard/*',
name: 'Dashboard',
key: '/dashboard',
auth: true,
element: lazyLoad(Dashboard),
element: lazyLoad(Dashboard)
},
{
index: false,
path: '/403',
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

0 comments on commit e7a2459

Please sign in to comment.