index.js 995 Bytes
Newer Older
1 2 3 4 5
import { request } from '@wisdom-utils/utils';

const REQUEST_METHOD_GET = 'get';
const REQUEST_METHOD_POST = 'post';
// eslint-disable-next-line no-undef
6
const navigatorAgent = /(iPhone|iOS|Android|Windows Phone)/i.test(navigator?.userAgent);
7
const baseURI = typeof DUMI_TYPE !== 'undefined' && DUMI_TYPE === 'dumi' ? '/api' : '';
8
const CommonPath = navigatorAgent ? '/PandaCore/GateWay' : '';
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

// 录像回放
export function videoPlayback(params) {
  return request({
    url: `${baseURI}${CommonPath}/pandavms/camera/playback`,
    method: REQUEST_METHOD_GET,
    params,
  });
}

// 根据时间轴时间选定 查看历史视频
export function newPlayback(params) {
  return request({
    url: `${baseURI}${CommonPath}/pandavms/camera/newpalyback`,
    method: REQUEST_METHOD_GET,
    params,
  });
}
27 28 29 30 31 32 33 34 35

// 云台控制
export function controlSlim(data) {
  return request({
    url: `${baseURI}${CommonPath}/pandavms/camera/control/slim`,
    method: REQUEST_METHOD_POST,
    data,
  });
}