微信小程序授权订阅消息判断用户取消或允许
发表时间:2020-10-10
发布人:葵宇科技
浏览次数:87
wx.requestSubscribeMessage({
tmplIds: ["brWVvPuoLPI9_i1qo_37LPVLK2jDyTGLuGqLK9Ur9PA"],
success: function (res) {
if (res["brWVvPuoLPI9_i1qo_37LPVLK2jDyTGLuGqLK9Ur9PA"] == "accept") {
console.log("用户允许了")
} else if(res["brWVvPuoLPI9_i1qo_37LPVLK2jDyTGLuGqLK9Ur9PA"] == "reject") {
console.log("用户取消了")
}