Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hs-app-project
Project
Project
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
李星剑
hs-app-project
Commits
582254fc
Commit
582254fc
authored
Dec 02, 2021
by
李星剑
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 请求
parent
ebf9c885
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
request.js
src/config/request/request.js
+7
-0
No files found.
src/config/request/request.js
View file @
582254fc
...
...
@@ -98,12 +98,18 @@ export default class Request {
...
this
.
config
,
...
this
.
requestBefore
(
options
)
}
return
new
Promise
((
resolve
,
reject
)
=>
{
let
mergeUrl
=
Request
.
isUrl
(
options
.
url
)
?
options
.
url
:
(
options
.
baseUrl
+
options
.
url
)
if
(
JSON
.
stringify
(
options
.
params
)
!==
'{}'
)
{
let
query
=
Request
.
addQueryString
(
options
.
params
);
mergeUrl
+=
mergeUrl
.
indexOf
(
'?'
)
===
-
1
?
`?
${
query
}
`
:
`&
${
query
}
`
}
if
(
typeof
options
.
data
!==
'object'
){
mergeUrl
=
mergeUrl
+
'/'
+
options
.
data
;
options
.
data
=
{};
}
options
.
url
=
mergeUrl
options
.
success
=
res
=>
{
resolve
(
this
.
requestAfter
(
res
.
data
))
...
...
@@ -132,4 +138,5 @@ export default class Request {
})
}
}
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