ll
liukangdong
2024-08-06 d41f1f707dc643b726a42b9d2a63b186dd9e4f28
wechat_staff/pages/sets/index.js
@@ -1,4 +1,8 @@
// pages/sets/index.js
import {
  logout
} from '../../api/index'
Page({
  /**
@@ -15,17 +19,39 @@
  },
  showLogout() {
    this.setData({show: true})
    wx.showModal({
      title: '提示',
      content: '确认退出登录',
      success(res) {
        if (res.confirm) {
          logout({}).then(res => {
            const sessionKey = wx.getStorageSync('sessionKey')
            wx.clearStorageSync()
            setTimeout(() => {
              wx.setStorageSync('sessionKey', sessionKey)
              wx.redirectTo({
                url: '/pages/login/index',
              })
            }, 300)
          })
        }
      }
    })
  },
  onClose() {
    this.setData({show: false})
  },
  changeDeal(){
    wx.navigateTo({
      url: '/pages/sets/protocol',
    this.setData({
      show: false
    })
  },
  changeDeal(e) {
    wx.navigateTo({
      url: '/pages/sets/protocol?type=' + e.currentTarget.dataset.index,
    })
  },
  logout() {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */