feat : 表单权限处理

This commit is contained in:
clay
2024-05-30 22:31:47 +08:00
parent 7a5fbd501e
commit ee890c0e80
8 changed files with 71 additions and 39 deletions

View File

@@ -3,12 +3,12 @@
<Hamburger></Hamburger>
<Breadcrumb></Breadcrumb>
<div class="right-bar">
<!-- <bell-socket/>-->
<!-- <bell-socket/>-->
<div class="user-box">
<div>
<!-- <img :src="userInfo.avatar" alt="" @click.stop="handleVisitedP">-->
<span @click.stop="handleVisitedP">欢迎回来{{userInfo.userName}}</span>
</div>
<div>
<!-- <img :src="userInfo.avatar" alt="" @click.stop="handleVisitedP">-->
<span @click.stop="handleVisitedP">欢迎回来{{ userInfo.userName }}</span>
</div>
<div class="person" v-if="visitedP">
<ul>
<li @click="handleToAuth">个人中心</li>
@@ -25,8 +25,6 @@ import {useRouter} from 'vue-router';
import Breadcrumb from './Breadcrumb.vue';
import Hamburger from './Hamburger.vue';
import {useAuthStore} from '@/stores/userstore.js'
import BellSocket from "./BellSocket.vue";
import {getUserInfo} from "../../api/login";
import {usePermisstionStroe} from '@/stores/permisstion'
const authStore = useAuthStore()
@@ -41,10 +39,8 @@ onMounted(() => {
onBeforeUnmount(() => {
document.removeEventListener('click', nullBlockClick)
})
const setUserInfo = () => {
getUserInfo().then(res=>{
userInfo.value = res.data.user
})
const setUserInfo = () => {
userInfo.value = authStore.userinfo
}
const nullBlockClick = () => {
visitedP.value = false
@@ -74,22 +70,26 @@ const handleLogout = () => {
align-items: center;
background-color: #fff;
border-radius: 10px;
.right-bar {
margin-left: auto;
display: flex;
justify-content: flex-start;
align-items: center;
.user-box{
.user-box {
cursor: pointer;
margin-left: 10px;
position: relative;
>div:first-child{
display:flex;
> div:first-child {
display: flex;
align-items: center;
>span{
> span {
margin-left: 5px;
}
img {
width: 40px;
height: 40px;