修改退出登录逻辑,新增访问接口退出
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { alertInfo } from "../../utils/index";
|
||||
import { alertInfo, alertSuccess } from "../../utils/index";
|
||||
import Dialog from '@vant/weapp/dialog/dialog';
|
||||
import { getUserInfo } from "../../service/user";
|
||||
import { getUserInfo, logout } from "../../service/user";
|
||||
import { getDot } from "../../utils/system";
|
||||
import request from "../../utils/request"
|
||||
const { OK } = request;
|
||||
@@ -78,7 +78,12 @@ Page({
|
||||
dot
|
||||
})
|
||||
},
|
||||
logout() {
|
||||
async logout() {
|
||||
const { code, message } = await logout()
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
wx.clearStorageSync()
|
||||
wx.switchTab({
|
||||
url: '/pages/home/index',
|
||||
|
Reference in New Issue
Block a user