Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0c334ff4
authored
Aug 02, 2023
by
linr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
request支持传递axios原生参数,例如超时:request(method:'GET',url:'',timeout:1000)
parent
ee802d63
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletions
+2
-1
src/config/axios/index.ts
+2
-1
No files found.
src/config/axios/index.ts
View file @
0c334ff4
...
@@ -5,12 +5,13 @@ import { config } from './config'
...
@@ -5,12 +5,13 @@ import { config } from './config'
const
{
default_headers
}
=
config
const
{
default_headers
}
=
config
const
request
=
(
option
:
any
)
=>
{
const
request
=
(
option
:
any
)
=>
{
const
{
url
,
method
,
params
,
data
,
headersType
,
responseType
}
=
option
const
{
url
,
method
,
params
,
data
,
headersType
,
responseType
,
...
config
}
=
option
return
service
({
return
service
({
url
:
url
,
url
:
url
,
method
,
method
,
params
,
params
,
data
,
data
,
...
config
,
responseType
:
responseType
,
responseType
:
responseType
,
headers
:
{
headers
:
{
'Content-Type'
:
headersType
||
default_headers
'Content-Type'
:
headersType
||
default_headers
...
...
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