Browse Source

退出登录

fenbao
wangyx 1 month ago
parent
commit
a2e07dbe3b
  1. 7
      manifest.json
  2. 7
      pages/api.js
  3. 26
      pages/tabBar/mine/index.vue
  4. 1
      pagesA/checkout/detail/detail.vue

7
manifest.json

@ -56,7 +56,12 @@
"minified" : true
},
"usingComponents" : true,
"lazyCodeLoading" : "requiredComponents"
"lazyCodeLoading" : "requiredComponents",
"permission" : {
"scope.writePhotosAlbum" : {
"desc" : "需要获取相册权限"
}
}
},
"mp-alipay" : {
"usingComponents" : true

7
pages/api.js

@ -112,3 +112,10 @@ export function submitWaterAndElectricity(data) {
});
}
// 退出登录
export function logout() {
return request({
url: '/logout',
method: 'post'
})
}

26
pages/tabBar/mine/index.vue

@ -1,24 +1,24 @@
<template>
<view class="content">
<view>暂无数据</view>
<view>
<u-button type="primary" text="退出登录" @click="handleLogout"></u-button>
</view>
</view>
</template>
<script>
import { logout } from '@/pages/api'
export default {
data () {
return {
tabValue: 1,
}
},
onLoad () {
},
methods: {
onChange (name) {
this.tabValue = name;
console.log(name);
},
async handleLogout() {
try {
await logout();
} catch (e) {}
uni.removeStorageSync('token');
uni.reLaunch({
url: '/pages/login/login'
});
}
}
}
</script>

1
pagesA/checkout/detail/detail.vue

@ -1,4 +1,3 @@
import { detail } from '@/api/mz/contract';
<template>
<view class="checkout-detail-bg">
<!-- 房间图片 -->

Loading…
Cancel
Save