2***@qq.com
2***@qq.com
  • 发布:2025-04-20 12:54
  • 更新:2025-05-17 00:37
  • 阅读:111

unicloud支付宝云,请求网络超时 HttpClientRequestTimeoutError: Request timeout for 10000 ms

分类:uniCloud

产品分类: uniCloud/支付宝小程序云

App下载地址或H5⽹址: 小程序:我的物品录

示例代码:

// 获取库存充足商品
async getEnoughGoodsList({
page = 1,
pageSize = 20
}) {
const dbObj = uniCloud.databaseForJQL({
clientInfo: this.getClientInfo()
});
const uid = await checkLogin.call(this);
if (typeof uid === 'object') {
return uid;
}

    try {  
        const condition = {  
            user_id: uid,  
            $or: [{  
                    goods_threshold: null,  
                    goods_num: {  
                        $gt: 0  
                    }  
                },  
                {  
                    goods_threshold: '',  
                    goods_num: {  
                        $gt: 0  
                    }  
                },  
                {  
                    goods_num: null  
                },  
                {  
                    goods_num: ''  
                },  
                {  
                    $and: [{  
                            goods_threshold: {  
                                $exists: true,  
                                $ne: null,  
                                $ne: ''  
                            }  
                        },  
                        {  
                            goods_num: {  
                                $exists: true,  
                                $ne: null,  
                                $ne: ''  
                            }  
                        },  
                        {  
                            $expr: {  
                                $lt: ["$goods_threshold", "$goods_num"]  
                            }  
                        }  
                    ]  
                }  
            ]  
        };  
        const goodsInfo = await dbObj.collection('goods-info')  
            .where(condition)  
            .skip((page - 1) * pageSize)  
            .limit(pageSize)  
            .orderBy('last_modify_date', 'desc')  
            .get();  

        return {  
            code: 0,  
            msg: '获取成功',  
            data: goodsInfo.data  
        };  
    } catch (error) {  
        console.error('获取商品列表失败:', error);  
        return {  
            code: -2,  
            msg: '获取商品列表失败',  
            error: error.message  
        };  
    }  
},

操作步骤:

使用云对象

预期结果:

能正常返回下一页的数据

实际结果:

有时候第一页的数据无法返回,有时候第一页可以返回但是,下一页的数据无法返回

bug描述:

昨天好好的,今天出现超时问题,而且是多个用户出现这个问题,功能有时候可以,有时候就不可以,而且有时候uni-id-pages登录有超时
Error: HttpClientRequestTimeoutError: Request timeout for 10000 ms

2025-04-20 12:54 负责人:无 分享
已邀请:
风之源

风之源 - 我这么闲给你评论,是因为我的问题还没有人回答~

也许是数据库超时呢,你这没日志查不了的呀

2***@qq.com

2***@qq.com (作者) - zjx

我也是HttpClientRequestTimeoutError: Request timeout for 10000 ms

要回复问题请先登录注册