uni-app后端响应时间过长,如何添加uni.showToast过渡?

uni.request({
                                url:`${that.$baseUrl}/userInformation/registerIdCard`,
                                data: {
                                        frontImgId:this.personFileId,
                                        userId:this.userId,
                                        backImgId:this.badgeFileId
                                        
                                    },
                                method: 'GET',
                                header: {
                                    'access_token':that.$store.state.token
                                },                 
                                success: (res)=>{
                                    
                                    
                                },
                                fail: (err)=>{
                                    uni.showToast({
                                          title: '请求失败',
                                          duration: 2000,
                                          icon:'none'
                                    });
                                }
                            })
                

前端向该后端发请求,由于后端该接口调用了第三方接口,导致该接口响应时间较长,我想添加uni.showToast来进行过渡,可是不知道该如何添加?请赐教,不胜感激。

在请求前加个
wx.showLoading({
title: '加载中...',
})
请求后wx.hideLoading()关闭

你好这样加

img