Browse Source

edit style

pull/4373/head
陈帅 7 years ago
parent
commit
56fff6aa80
  1. 6
      src/layouts/BasicLayout.tsx
  2. 12
      src/utils/utils.ts

6
src/layouts/BasicLayout.tsx

@ -11,7 +11,7 @@ import React, { useState } from 'react';
import logo from '../assets/logo.svg';
import Authorized from '@/utils/Authorized';
import { formatMessage } from 'umi-plugin-react/locale';
import { isAntDesignProOrDev } from '@/utils/utils';
import { isAntDesignPro } from '@/utils/utils';
import {
BasicLayout as ProLayoutComponents,
BasicLayoutProps as ProLayoutComponentsProps,
@ -42,7 +42,7 @@ const menuDataRender = (menuList: MenuDataItem[]): MenuDataItem[] => {
};
const footerRender: BasicLayoutProps['footerRender'] = (_, defaultDom) => {
if (!isAntDesignProOrDev()) {
if (!isAntDesignPro()) {
return defaultDom;
}
return (
@ -51,7 +51,7 @@ const footerRender: BasicLayoutProps['footerRender'] = (_, defaultDom) => {
<div
style={{
textAlign: 'center',
padding: '0px 20px 20px',
padding: '0px 24px 24px',
}}
>
<a href="https://www.netlify.com" target="_blank">

12
src/utils/utils.ts

@ -5,14 +5,18 @@ export function isUrl(path: string) {
return reg.test(path);
}
// 给官方演示站点用,用于关闭真实开发环境不需要使用的特性
export function isAntDesignProOrDev() {
const { NODE_ENV } = process.env;
export function isAntDesignPro() {
if (ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site') {
return true;
}
return window.location.hostname === 'preview.pro.ant.design';
}
// 给官方演示站点用,用于关闭真实开发环境不需要使用的特性
export function isAntDesignProOrDev() {
const { NODE_ENV } = process.env;
if (NODE_ENV === 'development') {
return true;
}
return window.location.hostname === 'preview.pro.ant.design';
return isAntDesignPro();
}

Loading…
Cancel
Save