🐛 add interface access permissions

This commit is contained in:
landaiqing
2024-09-04 19:00:21 +08:00
parent 9b3a6d37de
commit ec6b0a9c9f
12 changed files with 94 additions and 54 deletions

View File

@@ -1,19 +1,23 @@
<template>
<div>
<h1>Welcome to Main Page</h1>
<!-- <AButton @click="handleClick">获取用户数据</AButton>-->
<AButton @click="handleClick">获取登录用户角色</AButton>
{{ data }}
</div>
</template>
<script setup lang="ts">
// import {useRequest} from "alova/client";
// import {getUserInfo} from "@/api/user";
//
// const {data, send} = useRequest(getUserInfo, {
// immediate: false
// });
// const handleClick = () => {
// send();
// };
import {useRequest} from "alova/client";
import {getUserPermissions} from "@/api/user";
import useStore from "@/store";
const {data, send} = useRequest(getUserPermissions, {
immediate: false
});
const handleClick = () => {
const userInfo = useStore().user;
const userId: string = userInfo.user.uid;
send(userId);
};
</script>
<style scoped>