退出功能开发完成

This commit is contained in:
java110 2020-02-28 08:55:33 +08:00
parent c6d5b22ef1
commit 3f13d8b32c
2 changed files with 31 additions and 3 deletions

View File

@ -24,7 +24,7 @@ const listComplaints = baseUrl + 'app/complaint.listComplaints'; //添加投诉
const saveComplaint = baseUrl + 'app/complaint'; //查询业主房间
const queryRoomsByOwner = baseUrl + 'app/room.queryRoomsByOwner'; //绑定业主
const userLogout = baseUrl + 'app/user.service.logout'; //绑定业主
const appUserBindingOwner = baseUrl + 'app/owner.appUserBindingOwner'; //查询绑定业主
@ -78,7 +78,7 @@ module.exports = {
applyVisitorApplicationKey: applyVisitorApplicationKey,
uploadOwnerPhoto: uploadOwnerPhoto,
getOwnerPhotoPath: getOwnerPhotoPath,
queryRoomsByOwner: queryRoomsByOwner,
userLogout: userLogout,
queryParkingSpacesByOwner: queryParkingSpacesByOwner,
queryFeeByParkingSpace: queryFeeByParkingSpace,
queryFeeByOwner: queryFeeByOwner,

View File

@ -127,7 +127,35 @@
this.logoutUser = false;
},
_doLogoutUser:function(){
let _data = {
token:wx.getStorageSync('token')
}
this.java110Context.request({
url: this.java110Constant.url.userLogout,
header: this.java110Context.getHeaders(),
method: "POST",
data: _data,
success: function(res) {
if(res.statusCode != 200){
uni.showToast({
icon:"none",
title: res.data
});
return ;
}
uni.clearStorageSync();
uni.navigateTo({
url:"/pages/login/login"
});
},
fail: function(error) {
//
uni.showToast({
title: '调用接口失败'
});
console.log(error);
}
});
}
}