mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-06 20:06:12 +08:00
format code
This commit is contained in:
parent
1d7d9b8fde
commit
584041aba6
@ -20,4 +20,12 @@ repos:
|
|||||||
hooks:
|
hooks:
|
||||||
- id: prettier
|
- id: prettier
|
||||||
types_or: [markdown, ts, tsx]
|
types_or: [markdown, ts, tsx]
|
||||||
|
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: admin-eslint
|
||||||
|
name: eslint
|
||||||
|
entry: bash -c 'yarn --cwd admin-frontend lint || exit 0'
|
||||||
|
language: system
|
||||||
|
pass_filenames: false
|
||||||
exclude: 'CHANGELOG.md'
|
exclude: 'CHANGELOG.md'
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
"start": "react-scripts start",
|
"start": "react-scripts start",
|
||||||
"build": "react-scripts build && cp -r -f build/* ../src/plugins/nonebot_bison/admin_page/dist",
|
"build": "react-scripts build && cp -r -f build/* ../src/plugins/nonebot_bison/admin_page/dist",
|
||||||
"test": "react-scripts test",
|
"test": "react-scripts test",
|
||||||
"eject": "react-scripts eject"
|
"eject": "react-scripts eject",
|
||||||
|
"lint": "eslint --fix src/**/*.ts src/**/*.tsx"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"extends": [
|
"extends": [
|
||||||
|
@ -18,16 +18,14 @@ function App() {
|
|||||||
}, [globalConfLoaded]);
|
}, [globalConfLoaded]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
globalConfLoaded
|
||||||
{ globalConfLoaded
|
|
||||||
&& (
|
&& (
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/auth/:code" element={<Auth />} />
|
<Route path="/auth/:code" element={<Auth />} />
|
||||||
<Route path="/unauthed" element={<Unauthed />} />
|
<Route path="/unauthed" element={<Unauthed />} />
|
||||||
<Route path="/home" element={<Home />} />
|
<Route path="/home" element={<Home />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
)}
|
)
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,11 +14,12 @@ export default function Auth() {
|
|||||||
dispatch(login(code));
|
dispatch(login(code));
|
||||||
}
|
}
|
||||||
}, [isLogin, code]);
|
}, [isLogin, code]);
|
||||||
return (
|
|
||||||
{ isLogin
|
if (isLogin) {
|
||||||
? <Navigate to="/home" />
|
return <Navigate to="/home" />;
|
||||||
: isFailed
|
}
|
||||||
? <Navigate to="/unauthed" />
|
if (isFailed) {
|
||||||
: <div> login </div>}
|
return <Navigate to="/unauthed" />;
|
||||||
);
|
}
|
||||||
|
return <div> login </div>;
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { SubscribeResp } from '../../utils/type';
|
|
||||||
import { useGetSubsQuery } from './subscribeConfigSlice';
|
|
||||||
|
|
||||||
export function SubscribeManager() {
|
export default function SubscribeManager() {
|
||||||
const {
|
|
||||||
data: subs,
|
|
||||||
isLoading,
|
|
||||||
isFetching,
|
|
||||||
isSuccess,
|
|
||||||
} = useGetSubsQuery();
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
</>
|
</>
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react';
|
import { createApi } from '@reduxjs/toolkit/query/react';
|
||||||
import { RootState } from '../../app/store';
|
import { StatusResp, SubscribeConfig, SubscribeResp } from '../../utils/type';
|
||||||
import { StatusResp, SubscribeResp, SubscribeConfig } from '../../utils/type';
|
|
||||||
import { subsribeUrl } from '../../utils/urls';
|
|
||||||
import { baseQueryWithAuth } from '../auth/authQuery';
|
import { baseQueryWithAuth } from '../auth/authQuery';
|
||||||
|
|
||||||
export const subscribeApi = createApi({
|
export const subscribeApi = createApi({
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { SubscribeManager } from '../features/subsribeConfigManager/SubscribeManager';
|
import SubscribeManager from '../features/subsribeConfigManager/SubscribeManager';
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user