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
b60c5305
Commit
b60c5305
authored
Sep 03, 2018
by
陈帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turn off caching by default
parent
1b94c656
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
src/utils/request.js
src/utils/request.js
+7
-1
src/utils/utils.js
src/utils/utils.js
+4
-0
No files found.
src/utils/request.js
View file @
b60c5305
...
@@ -2,6 +2,7 @@ import fetch from 'dva/fetch';
...
@@ -2,6 +2,7 @@ import fetch from 'dva/fetch';
import
{
notification
}
from
'
antd
'
;
import
{
notification
}
from
'
antd
'
;
import
router
from
'
umi/router
'
;
import
router
from
'
umi/router
'
;
import
hash
from
'
hash.js
'
;
import
hash
from
'
hash.js
'
;
import
{
isAntdPro
}
from
'
./utils
'
;
const
codeMessage
=
{
const
codeMessage
=
{
200
:
'
服务器成功返回请求的数据。
'
,
200
:
'
服务器成功返回请求的数据。
'
,
...
@@ -62,7 +63,12 @@ const cachedSave = (response, hashcode) => {
...
@@ -62,7 +63,12 @@ const cachedSave = (response, hashcode) => {
* @param {object} [options] The options we want to pass to "fetch"
* @param {object} [options] The options we want to pass to "fetch"
* @return {object} An object containing either "data" or "err"
* @return {object} An object containing either "data" or "err"
*/
*/
export
default
function
request
(
url
,
options
=
{})
{
export
default
function
request
(
url
,
options
=
{
expirys
:
isAntdPro
(),
}
)
{
/**
/**
* Produce fingerprints based on url and parameters
* Produce fingerprints based on url and parameters
* Maybe url has the same parameters
* Maybe url has the same parameters
...
...
src/utils/utils.js
View file @
b60c5305
...
@@ -207,3 +207,7 @@ export function formatWan(val) {
...
@@ -207,3 +207,7 @@ export function formatWan(val) {
}
}
return
result
;
return
result
;
}
}
export
function
isAntdPro
()
{
return
window
.
location
.
hostname
===
'
preview.pro.ant.design
'
;
}
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