import { defineStore } from "pinia"; import axios from "axios"; export const useRoleMode = defineStore("roleMode", () => { const typeUser = ref([]); const roleMenuById = ref([]); const getRoleMenuById = async (body: Record) => { 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 }; });