// pages/mine/setting/index.js
const app = getApp();
const {
  openIM
} = app.globalData;
Page({
  data: {
    userInfo: {}
  },
  onShow(options) {
    const that = this;
    const userInfo = wx.getStorageSync('userInfo')
    that.setData({
      userInfo
    })
  },
  //退出登录
  logOut() {
    wx.showModal({
      content: "您确定要退出登录吗",
      confirmText: "退出登录",
      confirmColor: "#FF0000",
      success: function (res) {
        if (res.confirm) {
          wx.clearStorageSync()
          app.loginout();
          wx.switchTab({
            url: '/page/tabBar/mine/index',
          })
          app.getWxCode();
        } else if (res.cancel) {}
      }
    })
  },
})