| | |
| | | wxLogOff, |
| | | wxLoginCustomer |
| | | } from '../../api/index' |
| | | import { eventBus } from '../../utils/eventBus' |
| | | import { |
| | | eventBus |
| | | } from '../../utils/eventBus' |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | show: false |
| | | show: false, |
| | | showLogout: false |
| | | }, |
| | | |
| | | /** |
| | |
| | | let that = this |
| | | wxLogOff().then(res => { |
| | | wx.clearStorage() |
| | | wx.showToast({ |
| | | title: '注销成功', |
| | | }) |
| | | that.setData({ |
| | | showLogout: true |
| | | }) |
| | | }) |
| | | }, |
| | | appClose() { |
| | | wx.login({ |
| | | timeout: 5000, |
| | | success(res) { |
| | | success: (res) => { |
| | | if (res.code) { |
| | | //发起网络请求 |
| | | wxLoginCustomer({ |
| | |
| | | if (res && res.data.token) { |
| | | wx.setStorageSync('sessionKey', res.data.sessionKey) |
| | | wx.setStorageSync('token', res.data.token) |
| | | wx.showToast({ |
| | | title: '注销成功', |
| | | this.setData({ |
| | | showLogout: false |
| | | }) |
| | | setTimeout(() => { |
| | | eventBus.emit("reloadHome") |
| | |
| | | url: '/pages/index/index', |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | changeDeal(e) { |