Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mingPayPc
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fengzhaoyu
mingPayPc
Commits
0734857c
Commit
0734857c
authored
Oct 28, 2019
by
liang ce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉OrgId
parent
2df7cb65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
axios.js
src/api/axios.js
+20
-19
No files found.
src/api/axios.js
View file @
0734857c
...
...
@@ -72,15 +72,16 @@ axios.interceptors.response.use(res => {
const
$http
=
{
post
:
(
url
,
data
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
postData
if
(
data
===
undefined
)
{
postData
=
{
orgId
:
localStorage
.
getItem
(
'orgId'
)
}
}
else
{
postData
=
data
postData
.
orgId
=
localStorage
.
getItem
(
'orgId'
)
}
// let postData
// if (data === undefined) {
// postData = {
// orgId: localStorage.getItem('orgId')
// }
// } else {
// postData = data
// postData.orgId = localStorage.getItem('orgId')
// }
let
postData
=
data
===
undefined
?
data
:
''
axios
.
post
(
`
${
BASE_URL
}${
url
}
`
,
postData
,
{
headers
:
{
'Content-Type'
:
'application/json; charset=UTF-8'
...
...
@@ -92,16 +93,16 @@ const $http = {
},
get
:
(
url
,
data
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
getData
if
(
data
===
undefined
)
{
getData
=
{
orgId
:
localStorage
.
getItem
(
'orgId'
)
}
}
else
{
getData
=
data
getData
.
orgId
=
localStorage
.
getItem
(
'orgId'
)
}
getData
=
qs
.
stringify
(
getData
)
//
let getData
//
if (data === undefined) {
//
getData = {
//
orgId: localStorage.getItem('orgId')
//
}
//
} else {
//
getData = data
//
getData.orgId = localStorage.getItem('orgId')
//
}
let
getData
=
data
?
qs
.
stringify
(
data
)
:
''
axios
.
get
(
`
${
BASE_URL
}${
url
}
?
${
getData
}
`
).
then
((
res
)
=>
{
return
resolve
(
res
)
})
...
...
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