MinhangService.js
923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import axios from 'axios';
class MinhangService{
constructor() {
this.$axios = axios;
}
getMinhangDeviceList(params, callback, errorCallback){
this.$axios({
method: 'get',
url:`/api/vehicle/query`,
params: {
...params
}
}).then((res) => {
if (typeof (callback) == "function") callback(res.data)
}).catch((error) => {
console.log(error);
if (typeof (errorCallback) == "function") errorCallback(error)
});
}
onPlay(deviceId,channel, callback, errorCallback){
this.$axios({
method: 'get',
url:`/api/vehicle/onPlay`,
params: {
deviceId,
channel,
}
}).then((res) => {
if (typeof (callback) == "function") callback(res.data)
}).catch((error) => {
console.log(error);
if (typeof (errorCallback) == "function") errorCallback(error)
});
}
}
export default MinhangService;