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

Taking the storage.get() interface as an example, the code looks like this:

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);

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); }}

}

</script>

The output is as follows: mobile game = mobile game

1

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