自动化工具callWxMethod(setStorage)存储的数据在重新启动后回退

发布于 9 年前作者 xiulanduan10140 次浏览最后编辑 9 年前来自 issues
const func1 = async() => {
    let miniProgram
    miniProgram = await automator.launch({
        cliPath,
        projectPath
    })
 
    await miniProgram.callWxMethod('setStorage', {
        key: 'sec',
        data: 'mysecret'
    });
 
    const sec = await   miniProgram.callWxMethod('getStorageSync', 'sec');
    console.log(`func1-sec after set: ${sec}`);
    await miniProgram.close();
}

执行上述代码,重新启动开发者工具后,发现sec字段不存在

2 回复
yhu
yhu1 楼6 年前

这边看了下工具重启 storage 就会丢失,我们查下。

jun65
jun652 楼6 年前

提供下工具的版本号和能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。