44 lines
959 B
JavaScript
44 lines
959 B
JavaScript
const URL = (window.BASE_URL ? window.BASE_URL : "") + "/one-api/dashboard_mcu/user/";
|
|
|
|
async function post(endpoint, prm) {
|
|
try {
|
|
var resp = await axios.post(URL + endpoint, prm)
|
|
if (resp.status != 200) {
|
|
return {
|
|
status: "ERR",
|
|
message: resp.statusText
|
|
}
|
|
}
|
|
return resp.data
|
|
} catch (e) {
|
|
return {
|
|
status: "ERR",
|
|
message: e.message
|
|
}
|
|
}
|
|
}
|
|
|
|
export async function save(prm) {
|
|
return post('save', prm)
|
|
}
|
|
|
|
export async function reset_password(prm) {
|
|
return post('reset_password', prm)
|
|
}
|
|
|
|
export async function assign_project(prm) {
|
|
return post('assign_project', prm)
|
|
}
|
|
|
|
export async function remove_project(prm) {
|
|
return post('remove_project', prm)
|
|
}
|
|
|
|
export async function search_project(prm) {
|
|
return post('search_project', prm)
|
|
}
|
|
|
|
export async function search(prm) {
|
|
return post('search', prm)
|
|
}
|