diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0bbdeaf..5ab468cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: with: node-version: ${{ matrix.node_version }} - run: echo ${{github.ref}} - - run: yarn + - run: npm install - run: yarn run lint - run: yarn run tsc - run: yarn run build diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1af65871..bba1b065 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,8 +9,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@master - - run: yarn - - run: yarn run lint + - run: npm install + - run: npm run lint # - run: yarn run tsc - name: Build and Deploy uses: JamesIves/github-pages-deploy-action@master @@ -25,4 +25,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} BRANCH: gh-pages FOLDER: 'dist/' - BUILD_SCRIPT: yarn && npm uninstall husky && yarn add umi-plugin-antd-theme umi-plugin-pro && npm run site && git checkout . && git clean -df + BUILD_SCRIPT: npm install && npm uninstall husky && yarn add umi-plugin-antd-theme umi-plugin-pro && npm run site && git checkout . && git clean -df diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 61d31f3f..3c302440 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,7 +16,7 @@ jobs: steps: - checkout: self clean: false - - script: yarn + - script: npm install displayName: install - script: npm run lint displayName: lint @@ -36,7 +36,7 @@ jobs: options: '-u root' steps: - - script: yarn + - script: npm install displayName: install - script: npm run test:all env: @@ -51,7 +51,7 @@ jobs: - task: NodeTool@0 inputs: versionSpec: '12.x' - - script: yarn + - script: npm install displayName: install - script: npm run lint displayName: lint @@ -74,7 +74,7 @@ jobs: - task: NodeTool@0 inputs: versionSpec: '12.x' - - script: yarn + - script: npm install displayName: install - script: npm run lint displayName: lint diff --git a/src/layouts/BasicLayout.tsx b/src/layouts/BasicLayout.tsx index 00fe96a8..e9e13c3b 100644 --- a/src/layouts/BasicLayout.tsx +++ b/src/layouts/BasicLayout.tsx @@ -52,13 +52,16 @@ export type BasicLayoutContext = { [K in 'location']: BasicLayoutProps[K] } & { const menuDataRender = (menuList: MenuDataItem[]): MenuDataItem[] => menuList.map((item) => { - const localItem = { ...item, children: item.children ? menuDataRender(item.children) : [] }; + const localItem = { + ...item, + children: item.children ? menuDataRender(item.children) : undefined, + }; return Authorized.check(item.authority, localItem, null) as MenuDataItem; }); const defaultFooterDom = ( = (props) => { )} onCollapse={handleMenuCollapse} menuItemRender={(menuItemProps, defaultDom) => { - if (menuItemProps.isUrl || !menuItemProps.path - || menuItemProps.children?.length) { + if (menuItemProps.isUrl || !menuItemProps.path) { return defaultDom; } - return {defaultDom}; }} breadcrumbRender={(routers = []) => [