Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
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
陈智峰
jinfa-platform
Commits
33df7ad3
Commit
33df7ad3
authored
Sep 01, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get请求支持对象传输
parent
45c937c1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
request.ts
src/utils/request.ts
+4
-0
No files found.
src/utils/request.ts
View file @
33df7ad3
...
@@ -5,6 +5,7 @@ import { history } from 'umi'
...
@@ -5,6 +5,7 @@ import { history } from 'umi'
import
{
message
}
from
'antd'
import
{
message
}
from
'antd'
import
{
getAuth
,
removeAuth
}
from
'./auth'
;
import
{
getAuth
,
removeAuth
}
from
'./auth'
;
import
{
GlobalConfig
}
from
'@/global/config'
;
import
{
GlobalConfig
}
from
'@/global/config'
;
import
qs
from
'qs'
export
type
CtlType
=
'none'
|
'message'
export
type
CtlType
=
'none'
|
'message'
// 根前缀请求路径
// 根前缀请求路径
...
@@ -77,6 +78,9 @@ baseRequest.interceptors.request.use((url: string, options: RequestOptionsInit):
...
@@ -77,6 +78,9 @@ baseRequest.interceptors.request.use((url: string, options: RequestOptionsInit):
memberId
,
memberId
,
token
token
}
}
options
.
paramsSerializer
=
params
=>
{
return
qs
.
stringify
(
params
,
{
arrayFormat
:
'brackets'
})
}
return
{
return
{
// 前缀如果已经带上api, 跳过自动补前缀
// 前缀如果已经带上api, 跳过自动补前缀
url
:
url
.
startsWith
(
'/api'
)
?
url
:
basePrefix
+
url
,
url
:
url
.
startsWith
(
'/api'
)
?
url
:
basePrefix
+
url
,
...
...
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