有两种方式获取用户的unionId 1、用wx.getUserInfo()函数去获取用户的encryptedData,然后把encryptedData传到后端。 2、用wx.login()函数获取用户的code,然后传到后端。