Browse Source

🔥 clean: remove unuse code (#6769)

* 🔥 clean: remove unuse code

* try use npm fix ci
pull/6779/head
陈帅 6 years ago
committed by GitHub
parent
commit
d9e7fa8607
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/ci.yml
  2. 6
      .github/workflows/deploy.yml
  3. 8
      azure-pipelines.yml
  4. 11
      src/layouts/BasicLayout.tsx

2
.github/workflows/ci.yml

@ -16,7 +16,7 @@ jobs:
with: with:
node-version: ${{ matrix.node_version }} node-version: ${{ matrix.node_version }}
- run: echo ${{github.ref}} - run: echo ${{github.ref}}
- run: yarn - run: npm install
- run: yarn run lint - run: yarn run lint
- run: yarn run tsc - run: yarn run tsc
- run: yarn run build - run: yarn run build

6
.github/workflows/deploy.yml

@ -9,8 +9,8 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@master uses: actions/checkout@master
- run: yarn - run: npm install
- run: yarn run lint - run: npm run lint
# - run: yarn run tsc # - run: yarn run tsc
- name: Build and Deploy - name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@master uses: JamesIves/github-pages-deploy-action@master
@ -25,4 +25,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
BRANCH: gh-pages BRANCH: gh-pages
FOLDER: 'dist/' 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

8
azure-pipelines.yml

@ -16,7 +16,7 @@ jobs:
steps: steps:
- checkout: self - checkout: self
clean: false clean: false
- script: yarn - script: npm install
displayName: install displayName: install
- script: npm run lint - script: npm run lint
displayName: lint displayName: lint
@ -36,7 +36,7 @@ jobs:
options: '-u root' options: '-u root'
steps: steps:
- script: yarn - script: npm install
displayName: install displayName: install
- script: npm run test:all - script: npm run test:all
env: env:
@ -51,7 +51,7 @@ jobs:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: '12.x' versionSpec: '12.x'
- script: yarn - script: npm install
displayName: install displayName: install
- script: npm run lint - script: npm run lint
displayName: lint displayName: lint
@ -74,7 +74,7 @@ jobs:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: '12.x' versionSpec: '12.x'
- script: yarn - script: npm install
displayName: install displayName: install
- script: npm run lint - script: npm run lint
displayName: lint displayName: lint

11
src/layouts/BasicLayout.tsx

@ -52,13 +52,16 @@ export type BasicLayoutContext = { [K in 'location']: BasicLayoutProps[K] } & {
const menuDataRender = (menuList: MenuDataItem[]): MenuDataItem[] => const menuDataRender = (menuList: MenuDataItem[]): MenuDataItem[] =>
menuList.map((item) => { 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; return Authorized.check(item.authority, localItem, null) as MenuDataItem;
}); });
const defaultFooterDom = ( const defaultFooterDom = (
<DefaultFooter <DefaultFooter
copyright={`${(new Date()).getFullYear()} 蚂蚁金服体验技术部出品`} copyright={`${new Date().getFullYear()} 蚂蚁金服体验技术部出品`}
links={[ links={[
{ {
key: 'Ant Design Pro', key: 'Ant Design Pro',
@ -132,11 +135,9 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
)} )}
onCollapse={handleMenuCollapse} onCollapse={handleMenuCollapse}
menuItemRender={(menuItemProps, defaultDom) => { menuItemRender={(menuItemProps, defaultDom) => {
if (menuItemProps.isUrl || !menuItemProps.path if (menuItemProps.isUrl || !menuItemProps.path) {
|| menuItemProps.children?.length) {
return defaultDom; return defaultDom;
} }
return <Link to={menuItemProps.path}>{defaultDom}</Link>; return <Link to={menuItemProps.path}>{defaultDom}</Link>;
}} }}
breadcrumbRender={(routers = []) => [ breadcrumbRender={(routers = []) => [

Loading…
Cancel
Save