31 lines
725 B
TypeScript
31 lines
725 B
TypeScript
import axios from "axios";
|
|
import { defineStore } from "pinia";
|
|
|
|
// export const useMySidebarStore = defineStore({
|
|
// id: 'mySidebarStore',
|
|
// state: () => ({ }),
|
|
// actions: {}
|
|
// })
|
|
|
|
export const useSidebarStore = defineStore("SidebarStore", () => {
|
|
const getSidebar = async () => {
|
|
console.log("aaaaa");
|
|
const res = await $fetch(
|
|
`http://10.10.150.131:8080/api/login/6835632801e46cf9c5551876`,
|
|
{
|
|
mode: "no-cors",
|
|
headers: {
|
|
"Access-Control-Allow-Origin": "*",
|
|
Accept: "application/json",
|
|
"Content-Type": "application/json",
|
|
},
|
|
}
|
|
).then((response) => {
|
|
console.log(response);
|
|
});
|
|
};
|
|
return {
|
|
getSidebar,
|
|
};
|
|
});
|