7***@qq.com
7***@qq.com
  • 发布:2021-07-03 17:18
  • 更新:2021-07-03 17:34
  • 阅读:468

【报Bug】APP发布成H5程序,在UC手机浏览器下面uni.getStorage没有获取到数据

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Windows 10 专业版 20H2

HBuilderX类型: 正式

HBuilderX版本号: 2.7.14

浏览器平台: 手机系统浏览器

浏览器版本: 手机UC浏览器

项目创建方式: HBuilderX

示例代码:

setTimeout(function() {
uni.getStorage({
key: 'environment_key',
success: function(res) {
_this.environment_key = res.data;
_this.channelToken();
setTimeout(function() {
// #ifdef APP-PLUS
_this.appuUpdate();
// #endif
}, 1000)
},
});
}, 1000)

操作步骤:

setTimeout(function() {
uni.getStorage({
key: 'environment_key',
success: function(res) {
_this.environment_key = res.data;
_this.channelToken();
setTimeout(function() {
// #ifdef APP-PLUS
_this.appuUpdate();
// #endif
}, 1000)
},
});
}, 1000)

预期结果:

setTimeout(function() {
uni.getStorage({
key: 'environment_key',
success: function(res) {
_this.environment_key = res.data;
_this.channelToken();
setTimeout(function() {
// #ifdef APP-PLUS
_this.appuUpdate();
// #endif
}, 1000)
},
});
}, 1000)

实际结果:

setTimeout(function() {
uni.getStorage({
key: 'environment_key',
success: function(res) {
_this.environment_key = res.data;
_this.channelToken();
setTimeout(function() {
// #ifdef APP-PLUS
_this.appuUpdate();
// #endif
}, 1000)
},
});
}, 1000)

bug描述:

setTimeout(function() {  
                                //通过断点,走到这里就停止了  
                uni.getStorage({  
                    key: 'environment_key',  
                    success: function(res) {  
                        _this.environment_key = res.data;  
                        _this.channelToken();  
                        setTimeout(function() {  
                            // #ifdef APP-PLUS  
                            _this.appuUpdate();  
                            // #endif  
                        }, 1000)  
                    },  
                });  
            }, 1000)
2021-07-03 17:18 负责人:无 分享
已邀请:
Punk

Punk

在 fail 回调查看失败结果

该问题目前已经被锁定, 无法添加新回复