访客页面 退出登录

This commit is contained in:
liyuanchao 2025-08-23 18:08:54 +08:00
parent 8d6c55007e
commit f259275adb
3 changed files with 891 additions and 814 deletions

View File

@ -9,6 +9,9 @@ const install = (Vue, vm) => {
// 将各个定义的接口名称统一放进对象挂载到vm.$u.api(因为vm就是this也即this.$u.api)下
vm.$u.api = {
//获取单位列表
getUnits:(params = {}) => vm.$u.get(config.adminPath+'/property/enum-fetcher/enum-values/getUnit',params),
getcode:(params= {}) => vm.$u.post(config.adminPath+'/property/visitorManagement/getcode',params),
spfk:(params= {}) => vm.$u.put(config.adminPath+'/property/visitorManagement',params),
fklist:(params = {}) => vm.$u.get(config.adminPath+'/property/visitorManagement/list',params),

File diff suppressed because it is too large Load Diff

View File

@ -46,6 +46,9 @@
</u-cell-group>
</view>
</view>
<view class="button-wrapper">
<button class="logout-btn" @click="logout">退出登录</button>
</view>
</view>
</template>
<script>
@ -74,17 +77,23 @@ export default {
});
},
logout() {
this.$u.api.logout().then(res => {
this.$u.toast(res.msg);
if (res.code == '200' || res.code == '401') {
let self = this;
setTimeout(() => {
uni.reLaunch({
url: '/pages/sys/login/index'
});
}, 500);
}
//
this.$u.vuex('vuex_user', {});
this.$u.vuex('vuex_token', '');
uni.reLaunch({
url: '/pages/sys/login/index'
});
// this.$u.api.logout().then(res => {
// this.$u.toast(res.msg);
// if (res.code == '200' || res.code == '401') {
// let self = this;
// setTimeout(() => {
// uni.reLaunch({
// url: '/pages/sys/login/index'
// });
// }, 500);
// }
// });
},
upgrade(){
// #ifdef APP-PLUS
@ -117,8 +126,12 @@ export default {
page {
background-color: #f5f5f5;
}
.button-wrapper {
padding: 80rpx 0;
}
.wrap .u-cell-box .u-cell_title{
color:#202328;
margin-bottom: 80rpx;
}
.sign-in-images{
width: 125rpx;
@ -131,4 +144,18 @@ page {
height:50rpx;
}
}
.logout-btn {
width: 80vw;
height: 80rpx;
background: #0090FF;
color: #fff;
font-size: 32rpx;
border: none;
border-radius: 40rpx;
display: block;
box-shadow: 0 18rpx 24rpx rgba(0, 0, 0, 0.18);
font-weight: bold;
margin: 0 auto;
}
</style>