session, perbaikan lain lain
This commit is contained in:
No files matched your search
@@ -1,26 +0,0 @@
|
||||
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", {
|
||||
// mode: "no-cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method:"GET",
|
||||
})
|
||||
.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 };
|
||||
});
|
||||
@@ -1,29 +0,0 @@
|
||||
import { defineStore } from "pinia";
|
||||
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);
|
||||
// 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);
|
||||
}).catch((error) => {
|
||||
console.log(`Info Error : ${error}`)
|
||||
messages.value.title = 'Sambungan Sever Terputus!!!';
|
||||
messages.value.type = 'error';
|
||||
});
|
||||
// return roleMenuById;
|
||||
};
|
||||
return { getRoleMenuById, roleMenuById, typeUser };
|
||||
});
|
||||
@@ -1,22 +1,21 @@
|
||||
import {defineStore} from "pinia";
|
||||
import type {MessagesHandler} from "~/types/messagesHandler";
|
||||
|
||||
const runtime = useRuntimeConfig().public;
|
||||
const messages = ref<MessagesHandler>({});
|
||||
|
||||
export const useSettingStore = defineStore("SettingStore", () => {
|
||||
messages.value = {}
|
||||
const listMenu = ref<any>([]);
|
||||
const getMenu = async () => {
|
||||
await $fetch("/api/setting/getListMenu", {
|
||||
await $fetch(`${runtime.APIBASE}/menu/getlist`, {
|
||||
// await $fetch("/api/setting/getListMenu", {
|
||||
method: "GET",
|
||||
// mode: "no-cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
headers: {"Content-Type": "application/json"}
|
||||
})
|
||||
.then((res) => {
|
||||
listMenu.value = res
|
||||
// console.log(listMenu.value);
|
||||
// console.log("menu pinia :",listMenu.value);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -24,13 +23,15 @@ export const useSettingStore = defineStore("SettingStore", () => {
|
||||
const roleMenuById = ref<any>([]);
|
||||
const getRoleMenuById = async (body: Record<string, any>) => {
|
||||
typeUser.value = body;
|
||||
await $fetch(`/api/setting/getRoleMenu`, {
|
||||
console.log("rolemenu byid",body)
|
||||
// await $fetch(`/api/setting/getRoleMenu`, {
|
||||
await $fetch(`${runtime.APIBASE}/menu/role/type/${body}`, {
|
||||
// mode: "no-cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method: "POST",
|
||||
body: JSON.stringify(body),
|
||||
method: "GET",
|
||||
// body: JSON.stringify(body),
|
||||
}).then((res) => {
|
||||
roleMenuById.value = res;
|
||||
});
|
||||
@@ -38,8 +39,12 @@ export const useSettingStore = defineStore("SettingStore", () => {
|
||||
|
||||
const listTypeUser = ref<any>([]);
|
||||
const getTypeUser = async () => {
|
||||
await $fetch("/api/setting/getTipeUser", {
|
||||
// await $fetch("/api/setting/getTipeUser", {
|
||||
await $fetch(`${runtime.APIBASE}/menu/type`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
// mode: 'no-cors',
|
||||
// headers: {
|
||||
// 'Access-Control-Allow-Origin': '*',
|
||||
@@ -65,12 +70,15 @@ export const useSettingStore = defineStore("SettingStore", () => {
|
||||
}
|
||||
]
|
||||
}))
|
||||
|
||||
console.log("body post:",body.menus)
|
||||
// await $fetch(`/api/setting/deleteRoleMenuUser`, {
|
||||
// method: 'POST',
|
||||
// headers: {'Content-Type': 'application/json'},
|
||||
// body: JSON.stringify({key: body.menus[0].type_user_id})
|
||||
// }).then(async (res) => {
|
||||
await $fetch(`/api/setting/postRoleMenuUser`, {
|
||||
// await $fetch(`/api/setting/postRoleMenuUser`, {
|
||||
await $fetch(`${runtime.APIBASE}/menu/update/rolemenu?id=${body.menus[0].type_user_id}`, {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify(roleUserMenu)
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
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,
|
||||
};
|
||||
});
|
||||
@@ -1,28 +0,0 @@
|
||||
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", {
|
||||
// mode: 'no-cors',
|
||||
// headers: {
|
||||
// 'Access-Control-Allow-Origin': '*',
|
||||
// Accept: 'application/json',
|
||||
// 'Content-Type': 'application/json',
|
||||
// },
|
||||
method:"GET",
|
||||
})
|
||||
.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