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
07adcdc5
Commit
07adcdc5
authored
Jun 04, 2019
by
陈帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix cr warning
parent
dc505305
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
src/layouts/BasicLayout.tsx
src/layouts/BasicLayout.tsx
+2
-2
src/utils/utils.ts
src/utils/utils.ts
+8
-6
No files found.
src/layouts/BasicLayout.tsx
View file @
07adcdc5
...
...
@@ -50,14 +50,14 @@ const footerRender: BasicLayoutProps['footerRender'] = (_, defaultDom) => {
{
defaultDom
}
<
div
style
=
{
{
textAlign
:
'
center
'
,
padding
:
'
0px 24px 24px
'
,
textAlign
:
'
center
'
,
}
}
>
<
a
href
=
"https://www.netlify.com"
target
=
"_blank"
>
<
img
src
=
"https://www.netlify.com/img/global/badges/netlify-color-bg.svg"
width
=
{
82
}
width
=
"82px"
alt
=
"netlify logo"
/>
</
a
>
...
...
src/utils/utils.ts
View file @
07adcdc5
/* eslint no-useless-escape:0 import/prefer-default-export:0 */
const
reg
=
/
(((
^https
?
:
(?:\/\/)?)(?:[
-;:&=
\+\$
,
\w]
+@
)?[
A-Za-z0-9.-
]
+
(?:
:
\d
+
)?
|
(?:
www.|
[
-;:&=
\+\$
,
\w]
+@
)[
A-Za-z0-9.-
]
+
)((?:\/[\+
~%
\/
.
\w
-_
]
*
)?\??(?:[
-
\+
=&;%@.
\w
_
]
*
)
#
?(?:[\w]
*
))?)
$/
;
export
function
isUrl
(
path
:
string
)
{
const
isUrl
=
(
path
:
string
):
boolean
=>
{
return
reg
.
test
(
path
);
}
}
;
export
function
isAntDesignPro
():
boolean
{
const
isAntDesignPro
=
():
boolean
=>
{
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
():
boolean
{
const
isAntDesignProOrDev
=
():
boolean
=>
{
const
{
NODE_ENV
}
=
process
.
env
;
if
(
NODE_ENV
===
'
development
'
)
{
return
true
;
}
return
isAntDesignPro
();
}
};
export
{
isAntDesignProOrDev
,
isAntDesignPro
,
isUrl
};
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