增加新版本web页面
This commit is contained in:
50
web/src/store/modules/play.js
Normal file
50
web/src/store/modules/play.js
Normal file
@@ -0,0 +1,50 @@
|
||||
import { broadcastStart, broadcastStop, play, stop } from '@/api/play'
|
||||
|
||||
const actions = {
|
||||
play({ commit }, [deviceId, channelId]) {
|
||||
return new Promise((resolve, reject) => {
|
||||
play(deviceId, channelId).then(response => {
|
||||
const { data } = response
|
||||
resolve(data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
stop({ commit }, [deviceId, channelId]) {
|
||||
return new Promise((resolve, reject) => {
|
||||
stop(deviceId, channelId).then(response => {
|
||||
const { data } = response
|
||||
resolve(data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
broadcastStart({ commit }, [deviceId, channelId, broadcastMode]) {
|
||||
return new Promise((resolve, reject) => {
|
||||
broadcastStart(deviceId, channelId, broadcastMode).then(response => {
|
||||
const { data } = response
|
||||
resolve(data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
broadcastStop({ commit }, [deviceId, channelId]) {
|
||||
return new Promise((resolve, reject) => {
|
||||
broadcastStop(deviceId, channelId).then(response => {
|
||||
const { data } = response
|
||||
resolve(data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
actions
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user