getBackgroundFetchData:fail getBackground
发布于 5 年前 作者 efan 4122 次浏览 来自 官方Issues

getBackgroundFetchData:fail getBackgroundFetchData:fail data not found

3 回复

开发者工具上 - 右上角详情 - 启用数据预拉取 - 基础库调整到2.8.0+ - 真机调试

请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

您好,请问该问题是如何解决的呢。按照文档说,该接口getBackgroundFetchData可以获取微信服务器从应用服务器上预先拉取的数据。但是我配置后,返回的错误是没有数据。并且服务器上也配置了数据下载地址:

数据下载地址https://mzoon-wechat.caishuib.com/wxapp/fetch

wx.getBackgroundFetchData({

     fetchType: ‘periodic’,

     success(res) {

 console.log(“数据拉取成功”);

       console.log(res.fetchedData) // 缓存数据

       console.log(res.timeStamp) // 客户端拿到缓存数据的时间戳

       console.log(res.path) // 页面路径

       console.log(res.query) // query 参数

       console.log(res.scene) // 场景值

     },fail(res){

 console.log(“拉取失败了”);

  console.log(res);

 },complete(){

 

 console.log(“拉取操作完成”)

 }

   })

回到顶部