Flatten nested repos
This commit is contained in:
140
test/vuex/one-admin-mcu/api/admin.js
Normal file
140
test/vuex/one-admin-mcu/api/admin.js
Normal file
@@ -0,0 +1,140 @@
|
||||
const URL = "/one-api/etl/admin_v2/";
|
||||
|
||||
export async function search(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'search', 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 list_mcu_order(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'list_mcu_order', 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 search_company(token, prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'search_company', {
|
||||
token: token,
|
||||
search: 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 search_mou_multiple(token, companyId) {
|
||||
// try {
|
||||
// var resp = await axios.post(URL + 'search_mou_multiple', {
|
||||
// token: token,
|
||||
// companyId: companyId
|
||||
// });
|
||||
// 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 addMcu(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'addMcu', 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 editMcu(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'editMcu', 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 deleteMcu(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'deleteMcu', 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
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user