How to customize the pictures generated by WeChat Mini Programs's forwarding and sharing function?

onShareAppMessage: function() {
    return {
      title: "xxxx",
      path: "xxxx",
      imageUrl: "",
      success: (res) => {
        console.log(res)
      },
      fail: (res) => {
        console.log(res)
      }
    }
  },

the effect image forwarded by this method is a screenshot of that page.
how to become a self-defined picture?

Feb.22,2022

what is the path of your page? local pictures and network resources are all available. There is no problem with using the absolute path to try


code. First make sure that the path of your picture is specified correctly. You can test
preview onShareAppMessage


the image placed on the server with an official example.


res is not written in parentheses

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eab556-2047.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eab556-2047.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?