访客页面 退出登录
This commit is contained in:
parent
8d6c55007e
commit
f259275adb
@ -9,6 +9,9 @@ const install = (Vue, vm) => {
|
|||||||
|
|
||||||
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
||||||
vm.$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),
|
getcode:(params= {}) => vm.$u.post(config.adminPath+'/property/visitorManagement/getcode',params),
|
||||||
spfk:(params= {}) => vm.$u.put(config.adminPath+'/property/visitorManagement',params),
|
spfk:(params= {}) => vm.$u.put(config.adminPath+'/property/visitorManagement',params),
|
||||||
fklist:(params = {}) => vm.$u.get(config.adminPath+'/property/visitorManagement/list',params),
|
fklist:(params = {}) => vm.$u.get(config.adminPath+'/property/visitorManagement/list',params),
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -46,6 +46,9 @@
|
|||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="button-wrapper">
|
||||||
|
<button class="logout-btn" @click="logout">退出登录</button>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@ -74,17 +77,23 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
logout() {
|
logout() {
|
||||||
this.$u.api.logout().then(res => {
|
// 清除用户信息并返回登录页
|
||||||
this.$u.toast(res.msg);
|
this.$u.vuex('vuex_user', {});
|
||||||
if (res.code == '200' || res.code == '401') {
|
this.$u.vuex('vuex_token', '');
|
||||||
let self = this;
|
uni.reLaunch({
|
||||||
setTimeout(() => {
|
url: '/pages/sys/login/index'
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/sys/login/index'
|
|
||||||
});
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
// 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(){
|
upgrade(){
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
@ -117,8 +126,12 @@ export default {
|
|||||||
page {
|
page {
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
.button-wrapper {
|
||||||
|
padding: 80rpx 0;
|
||||||
|
}
|
||||||
.wrap .u-cell-box .u-cell_title{
|
.wrap .u-cell-box .u-cell_title{
|
||||||
color:#202328;
|
color:#202328;
|
||||||
|
margin-bottom: 80rpx;
|
||||||
}
|
}
|
||||||
.sign-in-images{
|
.sign-in-images{
|
||||||
width: 125rpx;
|
width: 125rpx;
|
||||||
@ -131,4 +144,18 @@ page {
|
|||||||
height:50rpx;
|
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>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user