Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vipSupplier
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王淑敏
vipSupplier
Commits
7dc7a0b9
Unverified
Commit
7dc7a0b9
authored
Oct 03, 2020
by
fwfmiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix content-type error
parent
618a9983
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
25 deletions
+6
-25
src/utils/request.js
+6
-25
No files found.
src/utils/request.js
View file @
7dc7a0b9
...
@@ -20,22 +20,6 @@ let loadingInstance;
...
@@ -20,22 +20,6 @@ let loadingInstance;
/**
/**
* @author chuzhixin 1204505056@qq.com (不想保留author可删除)
* @author chuzhixin 1204505056@qq.com (不想保留author可删除)
* @description 判断当前url是否需要加loading
* @param {*} config
* @returns
*/
const
needLoading
=
(
config
)
=>
{
let
status
=
false
;
debounce
.
forEach
((
item
)
=>
{
if
(
Vue
.
prototype
.
$baseLodash
.
includes
(
config
.
url
,
item
))
{
status
=
true
;
}
});
return
status
;
};
/**
* @author chuzhixin 1204505056@qq.com (不想保留author可删除)
* @description 处理code异常
* @description 处理code异常
* @param {*} code
* @param {*} code
* @param {*} msg
* @param {*} msg
...
@@ -77,17 +61,14 @@ instance.interceptors.request.use(
...
@@ -77,17 +61,14 @@ instance.interceptors.request.use(
config
.
data
,
config
.
data
,
Vue
.
prototype
.
$baseLodash
.
identity
Vue
.
prototype
.
$baseLodash
.
identity
);
);
if
(
if
(
contentType
===
"application/x-www-form-urlencoded;charset=UTF-8"
&&
config
.
data
&&
config
.
data
config
.
headers
[
"Content-Type"
]
===
)
{
"application/x-www-form-urlencoded;charset=UTF-8"
)
config
.
data
=
qs
.
stringify
(
config
.
data
);
config
.
data
=
qs
.
stringify
(
config
.
data
);
}
if
(
debounce
.
some
((
item
)
=>
config
.
url
.
includes
(
item
)))
if
(
needLoading
(
config
))
{
loadingInstance
=
Vue
.
prototype
.
$baseLoading
();
loadingInstance
=
Vue
.
prototype
.
$baseLoading
();
}
return
config
;
return
config
;
},
},
(
error
)
=>
{
(
error
)
=>
{
...
@@ -99,7 +80,7 @@ instance.interceptors.response.use(
...
@@ -99,7 +80,7 @@ instance.interceptors.response.use(
(
response
)
=>
{
(
response
)
=>
{
if
(
loadingInstance
)
loadingInstance
.
close
();
if
(
loadingInstance
)
loadingInstance
.
close
();
const
{
status
,
data
,
config
}
=
response
;
const
{
data
,
config
}
=
response
;
const
{
code
,
msg
}
=
data
;
const
{
code
,
msg
}
=
data
;
// 操作正常Code数组
// 操作正常Code数组
const
codeVerificationArray
=
isArray
(
successCode
)
const
codeVerificationArray
=
isArray
(
successCode
)
...
...
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