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
2f1e44ec
Unverified
Commit
2f1e44ec
authored
Oct 03, 2020
by
good luck
Committed by
GitHub
Oct 03, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #98 from fwfmiao/master
🐛
fix content-type error
parents
618a9983
7dc7a0b9
Show 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 @
2f1e44ec
...
...
@@ -20,22 +20,6 @@ let loadingInstance;
/**
* @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异常
* @param {*} code
* @param {*} msg
...
...
@@ -77,17 +61,14 @@ instance.interceptors.request.use(
config
.
data
,
Vue
.
prototype
.
$baseLodash
.
identity
);
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
);
}
if
(
needLoading
(
config
))
{
if
(
debounce
.
some
((
item
)
=>
config
.
url
.
includes
(
item
)))
loadingInstance
=
Vue
.
prototype
.
$baseLoading
();
}
return
config
;
},
(
error
)
=>
{
...
...
@@ -99,7 +80,7 @@ instance.interceptors.response.use(
(
response
)
=>
{
if
(
loadingInstance
)
loadingInstance
.
close
();
const
{
status
,
data
,
config
}
=
response
;
const
{
data
,
config
}
=
response
;
const
{
code
,
msg
}
=
data
;
// 操作正常Code数组
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