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

update

上级 77e2e151
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</div> </div>
<div class="b"> <div class="b">
<div class="name">点击按钮观看回放</div> <div class="name">点击按钮观看回放</div>
<div class="play" @click="videoPlay(item.replay_url)"></div> <div class="play" @click="videoPlay(item.replay_url, item)"></div>
</div> </div>
</li> </li>
</template> </template>
...@@ -28,13 +28,23 @@ export default { ...@@ -28,13 +28,23 @@ export default {
}, },
data() { data() {
return { return {
listData: [] listData: [],
userName: ''
} }
}, },
mounted() { mounted() {
this.getList() this.getList()
this.getUser()
}, },
methods: { methods: {
getUser() {
action.Login.getUserInfo().then((res) => {
if (res.code === 0) {
console.log(res)
this.userName = res.data.username
}
})
},
getList() { getList() {
action.List.getPlaybackList({ room_id: this.$route.params.room_id }).then((res) => { action.List.getPlaybackList({ room_id: this.$route.params.room_id }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
...@@ -42,8 +52,22 @@ export default { ...@@ -42,8 +52,22 @@ export default {
} }
}) })
}, },
videoPlay(url) { videoPlay(url, data) {
window.location.href = url 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
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论