feat:体育活动、文化活动、品牌活动、系统金刚区 UI优化
This commit is contained in:
@@ -174,6 +174,12 @@
|
||||
// 所有 H5 Axios 请求先展示 Loading,等待 200ms 后再真正发出请求。
|
||||
window.bindH5AxiosLoading = function(axiosService) {
|
||||
axiosService.interceptors.request.use((config) => {
|
||||
// 页面自行展示骨架屏时保留请求延迟,但不叠加全局 Loading 遮罩。
|
||||
if (config.h5SkeletonLoading) {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => resolve(config), 200)
|
||||
})
|
||||
}
|
||||
h5PendingRequestCount++
|
||||
showH5GlobalLoading()
|
||||
return new Promise((resolve) => {
|
||||
@@ -184,12 +190,16 @@
|
||||
})
|
||||
|
||||
axiosService.interceptors.response.use((response) => {
|
||||
h5PendingRequestCount = Math.max(0, h5PendingRequestCount - 1)
|
||||
closeH5GlobalLoading()
|
||||
if (!response.config || !response.config.h5SkeletonLoading) {
|
||||
h5PendingRequestCount = Math.max(0, h5PendingRequestCount - 1)
|
||||
closeH5GlobalLoading()
|
||||
}
|
||||
return response
|
||||
}, (error) => {
|
||||
h5PendingRequestCount = Math.max(0, h5PendingRequestCount - 1)
|
||||
closeH5GlobalLoading()
|
||||
if (!error.config || !error.config.h5SkeletonLoading) {
|
||||
h5PendingRequestCount = Math.max(0, h5PendingRequestCount - 1)
|
||||
closeH5GlobalLoading()
|
||||
}
|
||||
return Promise.reject(error)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user