抖音小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

116 lines
2.5 KiB

<template>
<view class="container">
<uni-group mode="card">
<uni-list>
<uni-list-item title="清除缓存" :show-extra-icon="true" :extra-icon="clearCache" clickable showArrow @click="logoutUser">></uni-list-item>
<uni-list-item title="注销登录" :show-extra-icon="true" :extra-icon="logout" clickable showArrow @click="logoutUser"></uni-list-item>
</uni-list>
</uni-group>
</view>
</template>
<script>
import {
logout
} from '@/api/auth.js'
export default {
data() {
return {
clearCache: {
color:'#0000ff',
size: '22',
type: 'refresh'
},
logout: {
color:'#0000ff',
size: '22',
type: 'redo'
},
userInfo:{}
}
},
created() {
// const userInfo = uni.getStorageSync('userInfo')
// if (!userInfo) {
// console.log('havent userInfo')
// uni.showModal({
// content: '艺术家账户过期,请重新登录!',
// showCancel: false,
// success() {
// //没有缓存则跳转登录页面
// uni.reLaunch({
// url: '/pages/login/login'
// });
// }
// });
// } else {
// this.userInfo = userInfo;
// console.log('have userInfo')
// }
},
// // 下拉刷新
// onPullDownRefresh() {
// this.pageNum = 1
// this.inviteLogList = []
// this.getInviteLog();
// uni.stopPullDownRefresh()
// },
// // 上划加载更多
// onReachBottom() {
// if (this.inviteLogList.length > this.pageSize*this.pageNum-1) {
// this.flag = false;
// this.pageNum += 1
// this.getInviteLog();
// }else{
// this.flag = true;
// }
// },
methods: {
//注销
logoutUser(){
let that = this;
uni.showModal({
title: "提示",
content: "确定注销吗!",
showCancel: true,
success: function(ress){
if(ress.confirm){
logout().then(res => {
if (res.data.code === 200) {
uni.reLaunch({
url: '/pages/index/index',
success() {
uni.clearStorage();
uni.showToast({
title: '注销成功!',
duration: 2000
});
}
});
} else {
uni.showModal({
content: "注销失败,请联系管理员!",
showCancel: false,
});
}
});
}
}
});
}
}
}
</script>
<style lang="scss">
.ivOver{
width: 100%;
height:100rpx;
line-height: 100rpx;
text-align: center;
background: #fff;
font-size: 20rpx;
}
</style>