我要实现的功能就是首页在某个逻辑中,判断服务器是否出现异常,如果res返回为false,说明服务挂了,或者宕机了,这时,我会给用户一个对话框,点退出,则关闭小程序。
但是我找不到退出小程序的API,大家遇到过吗~
https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html
open-type 有效值:
wx.navigateTo
wx.navigateToMiniProgram
wx.redirectTo
wx.switchTab
wx.reLaunch
wx.navigateBack