Просмотр исходного кода

🔥 clean: remove unuse code (#6769)

* 🔥 clean: remove unuse code

* try use npm fix ci
陈帅 5 лет назад
Родитель
Сommit
d9e7fa8607
4 измененных файлов с 14 добавлено и 13 удалено
  1. 1 1
      .github/workflows/ci.yml
  2. 3 3
      .github/workflows/deploy.yml
  3. 4 4
      azure-pipelines.yml
  4. 6 5
      src/layouts/BasicLayout.tsx

+ 1 - 1
.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

+ 3 - 3
.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

+ 4 - 4
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

+ 6 - 5
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 = (
   <DefaultFooter
-    copyright={`${(new Date()).getFullYear()} 蚂蚁金服体验技术部出品`}
+    copyright={`${new Date().getFullYear()} 蚂蚁金服体验技术部出品`}
     links={[
       {
         key: 'Ant Design Pro',
@@ -132,11 +135,9 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
       )}
       onCollapse={handleMenuCollapse}
       menuItemRender={(menuItemProps, defaultDom) => {
-        if (menuItemProps.isUrl || !menuItemProps.path
-          || menuItemProps.children?.length) {
+        if (menuItemProps.isUrl || !menuItemProps.path) {
           return defaultDom;
         }
-
         return <Link to={menuItemProps.path}>{defaultDom}</Link>;
       }}
       breadcrumbRender={(routers = []) => [