1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<template>
<div class="ultraman_wrap_bg">
<div class="form-container">
<van-cell title="绑定账号" :value="userInfo?.sysUser?.realname" />
<van-cell title="修改登录密码" is-link @click="handleClick('/user/editpassword')" />
<var-button block class="logout-btn" @click="handleLogout">
退出登录
</var-button>
</div>
</div>
</template>
<script setup>
import { onMounted } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || '{}')
// 处理退出登录
const handleLogout = () => {
showDialog({
title: '提示',
message: '确认要退出当前账号吗?',
showCancelButton: true,
}).then(async () => {
sessionStorage.clear()
router.push('/login')
}).catch(() => {
console.log('取消')
})
}
// 页面跳转
const handleClick = (url) => {
router.push(url)
}
</script>
<style lang="scss" scoped>
.ultraman_wrap_bg{
height: calc(100vh - 48px);
background: url("@/static/commonbg.png");
background-size: 100% 100%;
background-repeat: no-repeat;
padding-bottom: 20px;
box-sizing: border-box;
padding-top: 10px;
}
.form-container {
box-sizing: border-box;
margin: 20px;
padding: 20px;
background: #fff;
border-radius: 10px;
overflow: hidden;
:deep(.var-button) {
margin-top: 20px;
background: #e50112;
color: #fff;
}
}
</style>