封装请求方法
This commit is contained in:
parent
7b5bb1aea7
commit
f1d2740689
|
@ -6,12 +6,13 @@ export const getSuperboxApiConfig = (address) => {
|
||||||
const LOGIN_ROUTE = BASE_ROUTE + "/auth/login";
|
const LOGIN_ROUTE = BASE_ROUTE + "/auth/login";
|
||||||
const LOGOUT_ROUTE = BASE_ROUTE + "/auth/logout";
|
const LOGOUT_ROUTE = BASE_ROUTE + "/auth/logout";
|
||||||
const CAMERA_ROUTE = BASE_ROUTE + "/camera/cameras";
|
const CAMERA_ROUTE = BASE_ROUTE + "/camera/cameras";
|
||||||
const EVENTS_ROUTE = BASE_ROUTE + "/event/events";
|
const EVENTS_ROUTE = BASE_ROUTE + "/event/events?limit=300";
|
||||||
const ALGORITHM_ROUTE = BASE_ROUTE + "/algorithms";
|
const ALGORITHM_ROUTE = BASE_ROUTE + "/algorithms";
|
||||||
|
|
||||||
let addr = address;
|
let addr = address;
|
||||||
if (!addr) {
|
if (!addr) {
|
||||||
addr = window.location.host.replace(/:\d+/, "");
|
addr = window.location.host.replace(/:\d+/, "");
|
||||||
|
console.log("No address provided, using " + addr);
|
||||||
}
|
}
|
||||||
const superboxAddress = "http://" + addr + ":" + PORT.toString();
|
const superboxAddress = "http://" + addr + ":" + PORT.toString();
|
||||||
|
|
||||||
|
@ -155,4 +156,5 @@ export default {
|
||||||
getSuperboxApiConfig,
|
getSuperboxApiConfig,
|
||||||
initCodeNameMap,
|
initCodeNameMap,
|
||||||
codenameTranslate,
|
codenameTranslate,
|
||||||
|
getAlgorithms,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue