自动化工具callWxMethod(setStorage)存储的数据在重新启动后回退
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 回复