| | |
| | | // pages/sets/index.js |
| | | |
| | | import { logout } from '../../api/index' |
| | | import { |
| | | logout |
| | | } from '../../api/index' |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | |
| | | }, |
| | | showLogout() { |
| | | this.setData({show: true}) |
| | | wx.showModal({ |
| | | title: '提示', |
| | | content: '确认退出登录', |
| | | success(res) { |
| | | if (res.confirm) { |
| | | logout({}).then(res => { |
| | | wx.setStorageSync('member', null) |
| | | wx.setStorageSync('token', '') |
| | | wx.navigateTo({ |
| | | url: '/pages/login/index', |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | onClose() { |
| | | this.setData({show: false}) |
| | | this.setData({ |
| | | show: false |
| | | }) |
| | | }, |
| | | changeDeal(e){ |
| | | wx.navigateTo({ |
| | |
| | | }) |
| | | }, |
| | | logout(){ |
| | | logout({ |
| | | }).then(res => { |
| | | wx.setStorageSync('member', null) |
| | | wx.setStorageSync('token', '') |
| | | wx.navigateTo({ |
| | | url: '/pages/login/index', |
| | | }) |
| | | }) |
| | | |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |