Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
56fff6aa
Commit
56fff6aa
authored
Jun 03, 2019
by
陈帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit style
parent
8d9dee97
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
src/layouts/BasicLayout.tsx
src/layouts/BasicLayout.tsx
+3
-3
src/utils/utils.ts
src/utils/utils.ts
+8
-4
No files found.
src/layouts/BasicLayout.tsx
View file @
56fff6aa
...
@@ -11,7 +11,7 @@ import React, { useState } from 'react';
...
@@ -11,7 +11,7 @@ import React, { useState } from 'react';
import
logo
from
'
../assets/logo.svg
'
;
import
logo
from
'
../assets/logo.svg
'
;
import
Authorized
from
'
@/utils/Authorized
'
;
import
Authorized
from
'
@/utils/Authorized
'
;
import
{
formatMessage
}
from
'
umi-plugin-react/locale
'
;
import
{
formatMessage
}
from
'
umi-plugin-react/locale
'
;
import
{
isAntDesignPro
OrDev
}
from
'
@/utils/utils
'
;
import
{
isAntDesignPro
}
from
'
@/utils/utils
'
;
import
{
import
{
BasicLayout
as
ProLayoutComponents
,
BasicLayout
as
ProLayoutComponents
,
BasicLayoutProps
as
ProLayoutComponentsProps
,
BasicLayoutProps
as
ProLayoutComponentsProps
,
...
@@ -42,7 +42,7 @@ const menuDataRender = (menuList: MenuDataItem[]): MenuDataItem[] => {
...
@@ -42,7 +42,7 @@ const menuDataRender = (menuList: MenuDataItem[]): MenuDataItem[] => {
};
};
const
footerRender
:
BasicLayoutProps
[
'
footerRender
'
]
=
(
_
,
defaultDom
)
=>
{
const
footerRender
:
BasicLayoutProps
[
'
footerRender
'
]
=
(
_
,
defaultDom
)
=>
{
if
(
!
isAntDesignPro
OrDev
())
{
if
(
!
isAntDesignPro
())
{
return
defaultDom
;
return
defaultDom
;
}
}
return
(
return
(
...
@@ -51,7 +51,7 @@ const footerRender: BasicLayoutProps['footerRender'] = (_, defaultDom) => {
...
@@ -51,7 +51,7 @@ const footerRender: BasicLayoutProps['footerRender'] = (_, defaultDom) => {
<
div
<
div
style
=
{
{
style
=
{
{
textAlign
:
'
center
'
,
textAlign
:
'
center
'
,
padding
:
'
0px 2
0px 20
px
'
,
padding
:
'
0px 2
4px 24
px
'
,
}
}
}
}
>
>
<
a
href
=
"https://www.netlify.com"
target
=
"_blank"
>
<
a
href
=
"https://www.netlify.com"
target
=
"_blank"
>
...
...
src/utils/utils.ts
View file @
56fff6aa
...
@@ -5,14 +5,18 @@ export function isUrl(path: string) {
...
@@ -5,14 +5,18 @@ export function isUrl(path: string) {
return
reg
.
test
(
path
);
return
reg
.
test
(
path
);
}
}
// 给官方演示站点用,用于关闭真实开发环境不需要使用的特性
export
function
isAntDesignPro
()
{
export
function
isAntDesignProOrDev
()
{
const
{
NODE_ENV
}
=
process
.
env
;
if
(
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION
===
'
site
'
)
{
if
(
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION
===
'
site
'
)
{
return
true
;
return
true
;
}
}
return
window
.
location
.
hostname
===
'
preview.pro.ant.design
'
;
}
// 给官方演示站点用,用于关闭真实开发环境不需要使用的特性
export
function
isAntDesignProOrDev
()
{
const
{
NODE_ENV
}
=
process
.
env
;
if
(
NODE_ENV
===
'
development
'
)
{
if
(
NODE_ENV
===
'
development
'
)
{
return
true
;
return
true
;
}
}
return
window
.
location
.
hostname
===
'
preview.pro.ant.design
'
;
return
isAntDesignPro
()
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment