#
whycq
2023-10-19 efd62e7e5729cbd5c052837cf4c264fc7cef4ab6
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<template>
    <view>
        <view style="background-color: #fff;" @click="clickk">
            <view class="item">
                <view>角色</view><view class="item-right">{{detail.roleName}}</view>
                <view class="user-icons">
                    <uni-icons type="right" color="#c1c1c1"></uni-icons>
                </view>
            </view>
            <view class="item">
                <view>所属部门</view><view class="item-right">{{detail.deptName}}</view>
                <view class="user-icons">
                    <uni-icons type="right" color="#c1c1c1"></uni-icons>
                </view>
            </view>
            <view class="item">
                <view>账号</view><view class="item-right">{{detail.username}}</view>
                <view class="user-icons">
                    <uni-icons type="right" color="#c1c1c1"></uni-icons>
                </view>
            </view>
            <view class="item">
                <view>名称</view><view class="item-right">{{detail.nickname}}</view>
                <view class="user-icons">
                    <uni-icons type="right" color="#c1c1c1"></uni-icons>
                </view>
            </view>
            <view class="item">
                <view>联系方式</view><view class="item-right">{{detail.mobile}}</view>
                <view class="user-icons">
                    <uni-icons type="right" color="#c1c1c1"></uni-icons>
                </view>
            </view>
            <view class="item">
                <view>邮箱地址</view><view class="item-right">{{detail.email}}</view>
                <view class="user-icons">
                    <uni-icons type="right" color="#c1c1c1"></uni-icons>
                </view>
            </view>
            <view class="item">
                <view>密码</view><view class="item-right"></view>
                <view class="user-icons">
                    <uni-icons type="right" color="#c1c1c1"></uni-icons>
                </view>
            </view>
            <view class="item">
                <view>注册时间</view><view class="item-right">{{detail.createTime$}}</view>
                <view class="user-icons">
                    <uni-icons type="right" color="#c1c1c1"></uni-icons>
                </view>
            </view>
        </view>
        <view class="logOut" @click="logOut()">
            退出登录
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                detail: ''
            }
        },
        onShow() {
            this.getDetail()
        },
        methods: {
            getDetail() {
                let that = this
                uni.request({
                    url: that.baseUrl + '/user/detail/auth',
                    header: {'token' : uni.getStorageSync('token')},
                    method: 'POST',
                    success(res) {
                        res = res.data
                        if (res.code === 200) {
                            that.detail = res.data
                        } else if (res.code === 403) {
                            uni.showToast({title: res.msg, icon: "none", position: 'top'})
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../../login/login'
                                });
                            }, 1000);
                        } else {
                            uni.showToast({title: res.msg, icon: "none",position: 'top'})
                        }
                    }
                })
            },
            clickk() {
                uni.showToast({
                    icon:'error',
                    title: '暂不支持修改',
                    duration: 2000
                })
            },
            logOut() {
                uni.showToast({
                    title: '退出成功',
                    duration: 1000
                })
                setTimeout(() => {
                    uni.removeStorageSync('token');
                    uni.removeStorageSync('password');
                    uni.reLaunch({
                        url:"/pages/login/login"
                    });
                }, 1000);
            }
            
        }
    }
</script>
 
<style>
    * {
        font-weight: 700;
    }
    .item {
        background-color: #FFF;
        min-height: 90rpx;
        border-bottom: 1px solid #f1f1f1;
        margin-left: 30rpx;
        display: grid;
        grid-template-columns: 5fr 5fr 1fr;
        align-items: center;
    }
    .item:last-child {
        border: none;
    }
    .item-right {
        text-align: end;
        color: #6f6f6f;
        font-weight: 400;
    }
    .user-icons {
        text-align: center;
    }
    .logOut {
        height: 90rpx;
        line-height: 90rpx;
        text-align: center;
        background-color: #fff;
        margin-top: 30rpx;
    }
</style>