hapus
This commit is contained in:
+6
-1
@@ -2,6 +2,7 @@ import { defineStore } from "pinia";
|
||||
import axios from "axios";
|
||||
export const useMenu = defineStore("menu", () => {
|
||||
const listMenu = ref<any>([]);
|
||||
const messages = ref<any>({});
|
||||
const getMenu = async () => {
|
||||
// await $fetch("http://10.10.150.131:8080/api/menu/getlist", {
|
||||
await $fetch("/api/menu/listMenu", {
|
||||
@@ -14,7 +15,11 @@ export const useMenu = defineStore("menu", () => {
|
||||
.then((res) => {
|
||||
listMenu.value = res
|
||||
console.log(listMenu.value);
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.log(`Info Error : ${error}`)
|
||||
messages.value.title = 'Sambungan Sever Terputus!!!';
|
||||
messages.value.type = 'error';
|
||||
})
|
||||
// return listMenu;
|
||||
};
|
||||
return { getMenu,listMenu };
|
||||
|
||||
@@ -3,6 +3,7 @@ import axios from "axios";
|
||||
export const useRoleMode = defineStore("roleMode", () => {
|
||||
const typeUser = ref<any>([]);
|
||||
const roleMenuById = ref<any>([]);
|
||||
const messages = ref<any>({});
|
||||
const getRoleMenuById = async (body: Record<string, any>) => {
|
||||
typeUser.value = body;
|
||||
// console.log(typeUser.value);
|
||||
@@ -17,7 +18,11 @@ export const useRoleMode = defineStore("roleMode", () => {
|
||||
}).then((res) => {
|
||||
roleMenuById.value = res;
|
||||
// console.log(roleMenuById.value);
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.log(`Info Error : ${error}`)
|
||||
messages.value.title = 'Sambungan Sever Terputus!!!';
|
||||
messages.value.type = 'error';
|
||||
});
|
||||
// return roleMenuById;
|
||||
};
|
||||
return { getRoleMenuById, roleMenuById, typeUser };
|
||||
|
||||
+23
-21
@@ -1,5 +1,5 @@
|
||||
import axios from 'axios'
|
||||
import { defineStore } from 'pinia'
|
||||
import axios from "axios";
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
// export const useMySidebarStore = defineStore({
|
||||
// id: 'mySidebarStore',
|
||||
@@ -7,22 +7,24 @@ import { defineStore } from 'pinia'
|
||||
// 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
|
||||
}
|
||||
})
|
||||
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,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -2,6 +2,7 @@ import { defineStore } from "pinia";
|
||||
import axios from "axios";
|
||||
export const useTypeUser = defineStore("typeUser", () => {
|
||||
const listTypeUser = ref<any>([]);
|
||||
const messages = ref<any>({});
|
||||
const getTypeUser = async () => {
|
||||
// await $fetch("http://10.10.150.131:8080/api/menu/type", {
|
||||
await $fetch("/api/typeUser/listTypeUser", {
|
||||
@@ -16,7 +17,11 @@ export const useTypeUser = defineStore("typeUser", () => {
|
||||
.then((res) => {
|
||||
listTypeUser.value = res
|
||||
// console.log(listTypeUser.value);
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.log(`Info Error : ${error}`)
|
||||
messages.value.title = 'Sambungan Sever Terputus!!!';
|
||||
messages.value.type = 'error';
|
||||
});
|
||||
// return listTypeUser;
|
||||
};
|
||||
return { getTypeUser,listTypeUser };
|
||||
|
||||
Reference in New Issue
Block a user