用户登录&退出

This commit is contained in:
骆超
2023-05-06 17:03:05 +08:00
parent fea1c29b96
commit 767f164e59
5 changed files with 98 additions and 76 deletions

View File

@@ -76,6 +76,7 @@
<script>
import cloudSiteApi from '@/api/cloud-site.js'
import oilIdentityApi from "@/api/oil-identity";
export default {
data() {
return {
@@ -98,13 +99,22 @@
}
})
},
async loginOut() {
// await cloudSiteApi.logout();
uni.clearStorage()
uni.reLaunch({
url: '/pages/login/boforeLogin/boforeLogin?type=1' //
})
loginOut() {
oilIdentityApi.logout().then(res => {
if (res.code===20000){
uni.showToast({
title: '退出登录成功',
icon: 'success',
duration: 2000
});
setTimeout(()=>{
uni.clearStorage()
uni.reLaunch({
url: '/pages/login/boforeLogin/boforeLogin?type=1'
})
},2000)
}
})
},
getInfo() {
this.userInfo = uni.getStorageSync('loginUser')
@@ -179,4 +189,4 @@
.bg-img .cu-list.menu>.cu-item::after {
border-bottom: 0;
}
</style>
</style>