add
yirongjin
2025-07-23 d518ecbcbc853e891c389c422d1470b028ed1dc6
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
<template>
    <view>
        <view class="line">
            <text>用户名:</text>
            <text>{{admin}}</text>
        </view>
        <u-button type="success" @click="quit">退出登录</u-button>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                admin: ''
            };
        },
        onShow() {
                this.admin = uni.getStorageSync('admin');
        },
        methods: {
            back() {
                uni.navigateBack({
                    delta: 1
                })
            },
            quit() {
                uni.clearStorageSync()
                uni.navigateTo({
                    url: '../Login/index'
                })
            }
        }
    }
</script>
 
<style lang="scss">
    page {
        padding-bottom: 50px;
        height: 100%;
    }
 
    .line {
        height: 50px;
        border-bottom: 1px solid #eaeaea;
        padding-left: 3rem;
        font-size: 1rem;
        padding-right: 10px;
        display: flex;
        align-items: center;
    }
 
    .btn {
        position: fixed;
        bottom: 0px;
        width: 100%;
    }
</style>