```
_getTraceDot(nodeid, startTime = 0, endTime = 0) {
return new Promise((resolve, reject) => {
const params = {
token: this.$store.state.userInfoData.token,
nodeId: nodeid,
startTime: startTime,
endTime: endTime
};
let points = ''
this.$http.get('/device/getTrack', { params }).then(res => {
if (res.data.code == 200) {
resolve(res.data.data.points);
} else {
reject(res.data.msg);
}
}).catch(err => reject(err));
});
}
_getTraceDot.then(...).catch(...)
async _getTraceDot(nodeid, startTime = 0, endTime = 0) {
const params = {
token: this.$store.state.userInfoData.token,
nodeId: nodeid,
startTime: startTime,
endTime: endTime
};
let points = ''
const { data } = await this.$http.get('/device/getTrack', { params });
if (res.data.code == 200) {
points = res.data.data.points;
} else {
this.$message.error(res.data.msg);
}
return points;
}
_getTraceDot(...).then(res => console.log('points'));
```
网友评论