The developer can get the actual result returned by the interface from res.data and the failed return code from res.code.

Take the storage.get() interface as an example, the code is as follows:

1

module.exports = {

onDestroy: function () { console.info(“onDestroy”); }, getValue: async fuwww.diuxie.comnction () { try { let re = await storage.get({ key: ‘name’ }); console.info(“getValue re=”+JSON.stringify(re)); let value=re.data; } catch (error) { console.info(“getValue error=”+error);

This results in the following output for the mobile game:

1 getValue re={“data”:”hanmeimei”}