Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-lib
Project
Project
Details
Activity
Releases
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
郑磊
web-lib
Commits
aceab809
Commit
aceab809
authored
Mar 22, 2024
by
郑磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新axios实例的默认参数
parent
7de43669
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
create.ts
src/api/create.ts
+9
-2
No files found.
src/api/create.ts
View file @
aceab809
...
...
@@ -69,8 +69,15 @@ const INTERNAL_OPTION_KEYS: (keyof ApiRequestDefaultOptions)[] = [
/**
* 创建用于请求接口的Axios实例
*/
export
function
createAxiosInstance
():
ApiAxiosInstance
{
const
instance
=
axios
.
create
()
export
function
createAxiosInstance
(
options
:
CreateInstanceDefaults
=
{
source
:
'xinxiuweb'
,
app_version
:
'1.0.0'
,
device
:
'wap'
,
signature_secret
:
'asdasgfdwqew'
,
},
):
ApiAxiosInstance
{
const
instance
=
axios
.
create
(
options
)
//按倒序注入请求拦截器,最后处理的最先注入
//加密请求体
...
...
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