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
17ef65df
authored
Mar 29, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步 master 最新代码
parent
03db8fec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
50 deletions
+0
-50
src/config/axios/request.ts
+0
-50
No files found.
src/config/axios/request.ts
deleted
100644 → 0
View file @
03db8fec
import
{
service
}
from
'./service'
import
{
config
}
from
'./config'
const
{
default_headers
}
=
config
const
request
=
(
option
:
any
)
=>
{
const
{
url
,
method
,
params
,
data
,
headersType
,
responseType
}
=
option
return
service
({
url
:
url
,
method
,
params
,
data
,
responseType
:
responseType
,
headers
:
{
'Content-Type'
:
headersType
||
default_headers
}
})
}
export
default
{
get
:
async
<
T
=
any
>
(
option
:
any
)
=>
{
const
res
=
await
request
({
method
:
'GET'
,
...
option
})
return
res
as
unknown
as
T
},
post
:
async
<
T
=
any
>
(
option
:
any
)
=>
{
const
res
=
await
request
({
method
:
'POST'
,
...
option
})
return
res
as
unknown
as
T
},
delete
:
async
<
T
=
any
>
(
option
:
any
)
=>
{
const
res
=
await
request
({
method
:
'DELETE'
,
...
option
})
return
res
as
unknown
as
T
},
put
:
async
<
T
=
any
>
(
option
:
any
)
=>
{
const
res
=
await
request
({
method
:
'PUT'
,
...
option
})
return
res
as
unknown
as
T
},
patch
:
async
<
T
=
any
>
(
option
:
any
)
=>
{
const
res
=
await
request
({
method
:
'PATCH'
,
...
option
})
return
res
as
unknown
as
T
},
download
:
async
<
T
=
any
>
(
option
:
any
)
=>
{
const
res
=
await
request
({
method
:
'GET'
,
responseType
:
'blob'
,
...
option
})
return
res
as
unknown
as
Promise
<
T
>
},
upload
:
async
<
T
=
any
>
(
option
:
any
)
=>
{
option
.
headersType
=
'multipart/form-data'
const
res
=
await
request
({
method
:
'POST'
,
...
option
})
return
res
as
unknown
as
Promise
<
T
>
}
}
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