Commit 22d839c3 by zeyang

1.修复请求拦截器中参数拼接错误的问题

parent c07a9362
...@@ -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()
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment