|
@@ -0,0 +1,117 @@
|
|
|
+<template>
|
|
|
+ <div class="my-page" >
|
|
|
+ <div class="user-info" >
|
|
|
+ <div class="ava" >
|
|
|
+ {{userStore.userInfo.realname}}
|
|
|
+ </div>
|
|
|
+ <div class="dept" >
|
|
|
+ <div class="dept-item deptName" >
|
|
|
+ <div class="title" >部门名称:</div>
|
|
|
+ <div class="value" > {{userStore.userInfo.deptName}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="dept-item email" >
|
|
|
+ <div class="title" >邮箱:</div>
|
|
|
+ <div class="value" > {{userStore.userInfo.email}}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="logout-btn" @click="logout" >
|
|
|
+ 退出登录
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script lang='js' setup >
|
|
|
+ import { adminUsersRead } from '@/api/user'
|
|
|
+ import { onMounted, ref } from 'vue';
|
|
|
+ import { useUserStore } from '@/store/index'
|
|
|
+
|
|
|
+ const userStore = useUserStore()
|
|
|
+
|
|
|
+ const userInfo = ref({
|
|
|
+ realname: '',
|
|
|
+ deptName: '',
|
|
|
+ email: ''
|
|
|
+ })
|
|
|
+
|
|
|
+ const _adminUsersRead = async () => {
|
|
|
+ const { data } = await adminUsersRead()
|
|
|
+ console.log('data:', data)
|
|
|
+ userInfo.value = data
|
|
|
+ }
|
|
|
+
|
|
|
+ const logout = () => {
|
|
|
+ userStore.logout()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+ // _adminUsersRead()
|
|
|
+ })
|
|
|
+</script>
|
|
|
+<style lang='less' scoped >
|
|
|
+@import '../../styles/index.less';
|
|
|
+
|
|
|
+.my-page {
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ background-color: @page-color;
|
|
|
+ padding-top: 120px;
|
|
|
+ .user-info {
|
|
|
+ width: 702px;
|
|
|
+ height: 300px;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 24px;
|
|
|
+ margin: 0 auto;
|
|
|
+ padding: 24px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ // justify-content: space-between;
|
|
|
+
|
|
|
+ .ava {
|
|
|
+ width: 186px;
|
|
|
+ height: 186px;
|
|
|
+ background-color: rgb(1, 137, 255);
|
|
|
+ border-radius: 50%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ color: #fff;
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 40px;
|
|
|
+ margin-right: 48px;
|
|
|
+ }
|
|
|
+ .dept {
|
|
|
+ .dept-item {
|
|
|
+ width: 100%;
|
|
|
+ margin-bottom: 12px;
|
|
|
+ display: flex;
|
|
|
+ .title {
|
|
|
+ width: 160px;
|
|
|
+ text-align: right;
|
|
|
+ margin-right: 12px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .logout-btn {
|
|
|
+ width: 702px;
|
|
|
+ height: 96px;
|
|
|
+ background-color: @main-color;
|
|
|
+ border-radius: 48px;
|
|
|
+ margin: 24px auto;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 24px;
|
|
|
+ font-weight: 600;
|
|
|
+ cursor: pointer;
|
|
|
+ position: fixed;
|
|
|
+ bottom: 120px;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|