data dari api
This commit is contained in:
24
stores/api/roleMenu.ts
Normal file
24
stores/api/roleMenu.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { defineStore } from "pinia";
|
||||
import axios from "axios";
|
||||
export const useRoleMode = defineStore("roleMode", () => {
|
||||
const typeUser = ref<any>([]);
|
||||
const roleMenuById = ref<any>([]);
|
||||
const getRoleMenuById = async (body: Record<string, any>) => {
|
||||
typeUser.value = body;
|
||||
// console.log(typeUser.value);
|
||||
// await $fetch("http://10.10.150.131:8080/api/menu/getlist", {
|
||||
await $fetch(`/api/roleMenu/roleMenu`, {
|
||||
// mode: "no-cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method: "POST",
|
||||
body: JSON.stringify(body),
|
||||
}).then((res) => {
|
||||
roleMenuById.value = res;
|
||||
// console.log(roleMenuById.value);
|
||||
});
|
||||
// return roleMenuById;
|
||||
};
|
||||
return { getRoleMenuById, roleMenuById, typeUser };
|
||||
});
|
||||
Reference in New Issue
Block a user