Send a sharing request in onShareAppMessage (mini program)

I didn’t understand the document very clearly. After studying it for a while, I found that it is still difficult to understand the document.
Friends who can’t understand it can just use spicy

  onShareAppMessage() {
    const promise = new Promise(resolve => {
      request({
        api: '请求名',
        method: 'POST',
        data: {
          "data": {}
        }
      }).then(res => {
        resolve({
          title: '你要的标题',
          path: '/页面?code=' + res.code
        })
      })
    })
    return {promise}
  }

Personal test is effective

Guess you like

Origin blog.csdn.net/Yannnnnm/article/details/130266899