更新弹窗

This commit is contained in:
weipengfei 2023-08-19 09:24:55 +08:00
parent 6652da2387
commit e7ce4124d0

View File

@ -75,8 +75,10 @@
</view>
</block>
</view>
<view class="log_out" v-if="$store.state.app.token" @click="logout">退出登录</view>
<view class="log_out" v-if="$store.state.app.token" @click="modelShow=true">退出登录</view>
<view class="log_out" v-else @click="login">登录账号</view>
<u-modal :show="modelShow" title="警告" content='确定要退出登录吗' closeOnClickOverlay showCancelButton @close="modelShow=false" @cancel="modelShow=false" @confirm="logout"></u-modal>
<!-- <tabbar></tabbar> -->
</view>
</template>
@ -96,6 +98,7 @@
return {
myOaData: myOaData,
src: 'https://cdn.uviewui.com/uview/album/1.jpg',
modelShow: false
}
},
onReady() {
@ -107,6 +110,9 @@
onShow() {
this.getOaUserInfo();
},
onHide() {
this.modelShow = false;
},
computed: {
eyeType() {
return this.$store.state.config.eyeType;
@ -124,19 +130,19 @@
},
logout() {
let that = this;
uni.showModal({
content: '确定要退出登录吗',
success: (e) => {
if (e.confirm) {
// uni.showModal({
// content: '退',
// success: (e) => {
// if (e.confirm) {
uni.navigateTo({
url: '/pages/oaLogin/oaLogin?clear='+true,
success() {
that.$store.commit('CLEAR');
}
})
}
}
})
// }
// }
// })
},
async getOaUserInfo() {
const res = await userInfo();