mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-10 03:10:25 +08:00
feat: 前端升级至vue3,后端代码结构重构,新增权限管理相关功能
This commit is contained in:
35
mayfly_go_web/src/components/auth/auths.vue
Normal file
35
mayfly_go_web/src/components/auth/auths.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<div v-if="getUserAuthBtnList">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { useStore } from '/@/store/index.ts';
|
||||
export default {
|
||||
name: 'auths',
|
||||
props: {
|
||||
value: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const store = useStore();
|
||||
// 获取 vuex 中的用户权限
|
||||
const getUserAuthBtnList = computed(() => {
|
||||
let flag = false;
|
||||
store.state.userInfos.userInfos.authBtnList.map((val: any) => {
|
||||
props.value.map((v) => {
|
||||
if (val === v) flag = true;
|
||||
});
|
||||
});
|
||||
return flag;
|
||||
});
|
||||
return {
|
||||
getUserAuthBtnList,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user