Initial import
This commit is contained in:
39
apps/api/system/menu-bkp.js
Normal file
39
apps/api/system/menu-bkp.js
Normal file
@@ -0,0 +1,39 @@
|
||||
const URL = window.BASE_URL + "/one-api/mockup/system/";
|
||||
|
||||
export async function get_bread_crumb(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'menu/get_bread_crumb', {token:token,
|
||||
xref:window.location.href});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function get_menu(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'menu/get_menu', {token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
65
apps/api/system/menu.js
Normal file
65
apps/api/system/menu.js
Normal file
@@ -0,0 +1,65 @@
|
||||
const URL = window.BASE_URL + "/one-api/mockup/system/";
|
||||
|
||||
export async function change_password(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'menu/change_password', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function get_bread_crumb(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'menu/get_bread_crumb', {token:token,
|
||||
xref:window.location.href});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function get_menu(token) {
|
||||
try {
|
||||
let currentLocation = window.location.pathname;
|
||||
var resp = await axios.post(URL + 'menu/get_menu', {token:token, path:currentLocation});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
if(data.status == "ERRMENU"){
|
||||
window.location.replace("/"+data.menu)
|
||||
console.log("dasdasd")
|
||||
}
|
||||
else
|
||||
return data;
|
||||
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user