Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chao Sun
CFFP-HB
Commits
22d839c3
Commit
22d839c3
authored
Aug 14, 2023
by
zeyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修复请求拦截器中参数拼接错误的问题
parent
c07a9362
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
util/interceptor.ts
+3
-2
No files found.
util/interceptor.ts
View file @
22d839c3
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
const
whiteApiList
=
[
`
${
apiURL
}
/authorize/obtainToken`
,
`
${
apiURL
}
/authorize/checkToken`
,
`
${
cffpURL
}
/user/loginVerification`
,
`
${
apiURL
}
/appVersion/checkIsUpdate`
,
const
whiteApiList
=
[
`
${
apiURL
}
/authorize/obtainToken`
,
`
${
apiURL
}
/authorize/checkToken`
,
`
${
cffpURL
}
/user/loginVerification`
,
`
${
apiURL
}
/appVersion/checkIsUpdate`
,
`
${
cffpURL
}
/accessLog/accessLogSave`
,
`
${
cffpURL
}
/user/powerQuery`
];
`
${
cffpURL
}
/accessLog/accessLogSave`
,
`
${
cffpURL
}
/user/powerQuery`
];
export
const
interceptor
=
()
=>
{
export
const
interceptor
=
()
=>
{
uni
.
addInterceptor
(
'request'
,
{
uni
.
addInterceptor
(
'request'
,
{
// 请求拦截器
// 请求拦截器
...
@@ -13,9 +12,10 @@ export const interceptor = () => {
...
@@ -13,9 +12,10 @@ export const interceptor = () => {
// uni.showLoading({
// uni.showLoading({
// title: '加载中...'
// title: '加载中...'
// });
// });
// 当本地没有token,并且接口地址没在白名单内,需要重新获取token
// 当本地没有token,并且接口地址没在白名单内,需要重新获取token
if
(
!
uni
.
getStorageSync
(
'uni-token'
)
&&
!
whiteApiList
.
includes
(
args
.
url
))
{
if
(
!
uni
.
getStorageSync
(
'uni-token'
)
&&
!
whiteApiList
.
includes
(
args
.
url
))
{
const
params
=
{
const
params
=
{
ticket
:
'uni-app'
,
ticket
:
'uni-app'
,
loginId
:
null
loginId
:
null
...
@@ -71,6 +71,7 @@ export const interceptor = () => {
...
@@ -71,6 +71,7 @@ export const interceptor = () => {
// uni.hideLoading()
// uni.hideLoading()
},
},
complete
()
{
complete
()
{
// uni.hideLoading()
// uni.hideLoading()
}
}
})
})
...
...
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