提交 7290e2f1 authored 作者: lihuihui's avatar lihuihui

update

上级 77e2e151
......@@ -12,7 +12,7 @@
</div>
<div class="b">
<div class="name">点击按钮观看回放</div>
<div class="play" @click="videoPlay(item.replay_url)"></div>
<div class="play" @click="videoPlay(item.replay_url, item)"></div>
</div>
</li>
</template>
......@@ -28,13 +28,23 @@ export default {
},
data() {
return {
listData: []
listData: [],
userName: ''
}
},
mounted() {
this.getList()
this.getUser()
},
methods: {
getUser() {
action.Login.getUserInfo().then((res) => {
if (res.code === 0) {
console.log(res)
this.userName = res.data.username
}
})
},
getList() {
action.List.getPlaybackList({ room_id: this.$route.params.room_id }).then((res) => {
if (res.code === 0) {
......@@ -42,9 +52,23 @@ export default {
}
})
},
videoPlay(url) {
videoPlay(url, data) {
console.log(data, url)
if (data.liveRoom.type === 1) {
const urls = `${url}&autoLogin=true&viewername=${this.userName}&viewertoken=${this.randomString(6)}`
window.location.href = urls
} else {
window.location.href = url
}
},
randomString(length) {
const str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
let result = ''
for (let i = length; i > 0; --i) {
result += str[Math.floor(Math.random() * str.length)]
}
return result
}
}
}
</script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论