1.方法一(在页面上实现)
<!--此方法只需要在wxml里添加下面代码即可,无需用 bindtap关联函数-->
<navigator target="miniProgram" open-type="exit">
<button plain="true">退出登录</button>
</navigator>
2.方法二(在触发方法上实现)
//在需要退出小程序的地方调用添加下面代码即可(js文件中)
wx.exitMiniProgram({success: (res) => {}})