完善小程序登录排班与个人资料流程
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
const userApi = require('../../api/user')
|
||||
const authApi = require('../../api/auth')
|
||||
const auth = require('../../utils/auth')
|
||||
const profileCache = require('../../utils/profile-cache')
|
||||
|
||||
@@ -185,13 +184,5 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
async logout() {
|
||||
const confirmed = await new Promise(resolve => wx.showModal({ title: '退出登录', content: '退出后将关闭自动登录,并清除本机提醒设置。', success: result => resolve(result.confirm), fail: () => resolve(false) }))
|
||||
if (!confirmed) return
|
||||
try { await authApi.logout() } catch (error) {}
|
||||
getApp().logoutDevice()
|
||||
wx.reLaunch({ url: '/pages/login/index' })
|
||||
},
|
||||
|
||||
onUnload() { if (this.data.timer) clearInterval(this.data.timer) }
|
||||
})
|
||||
|
||||
@@ -30,5 +30,4 @@
|
||||
<button wx:elif="{{!closureRequest || closureRequest.status === 'REJECTED'}}" class="closure-btn" bindtap="requestClosure">申请注销账号</button>
|
||||
</block>
|
||||
</view>
|
||||
<button class="logout-btn" bindtap="logout">退出登录</button>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user