From 8c79571e1ba3da8a5514121cbfcf81aa32753af9 Mon Sep 17 00:00:00 2001 From: donghao Date: Fri, 19 Apr 2024 14:00:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 15 ++- config/routes.ts | 3 - jsconfig.json | 2 +- src/app.tsx | 10 +- src/components/TableActionCard/index.tsx | 6 +- src/layouts/index.tsx | 142 ++++++++++++----------- src/typings.d.ts | 8 ++ tsconfig.json | 2 - 8 files changed, 105 insertions(+), 83 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 8ffdff8..c71918d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,8 +1,11 @@ + module.exports = { - extends: [require.resolve('@umijs/lint/dist/config/eslint')], - globals: { - page: true, - REACT_APP_ENV: true, - SERVER_HOST: true, - }, + }; diff --git a/config/routes.ts b/config/routes.ts index e3ed45e..00dd485 100644 --- a/config/routes.ts +++ b/config/routes.ts @@ -44,12 +44,9 @@ export default [ }, ], }, - { path: '/system', - name: 'system', - routes: [ { name: 'api-list', diff --git a/jsconfig.json b/jsconfig.json index 197bee5..5643919 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -8,4 +8,4 @@ "@/*": ["./src/*"] } } -} +} \ No newline at end of file diff --git a/src/app.tsx b/src/app.tsx index 5141e14..7124919 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -46,6 +46,8 @@ export async function getInitialState(): Promise<{ if (location.pathname !== loginPath && localStorage.getItem('access')) { const currentUser = await fetchUserInfo(); const menus = await postMenuGetMenu(); + console.log('app_menus', menus.data.routes); + if (getLocale() === 'zh-CN') { let localData = getAllRouteNameTile(menus.data.routes, ''); let localRes: any = {}; @@ -88,7 +90,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = src: SERVER_HOST + initialState?.currentUser?.avatarUrl, title: , render: (_, avatarChildren) => { - console.log(avatarChildren,'111111111') + console.log(avatarChildren,'avatarProps') return {avatarChildren}; }, }, @@ -118,14 +120,18 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = userId: initialState?.currentUser?.id, }, request: async () => { - // console.log(initialState?.menuData,'initialState_menuData') + console.log(initialState?.menuData,'initialState_menuData') return initialState?.menuData || []; }, }, + // headerRender: () => <>导航栏, + // menuRender: () => <>, footerRender: () =>