|
|
@@ -24,12 +24,14 @@ export default {
|
|
|
DPlayer,
|
|
|
danmaku: {
|
|
|
api: process.env.VUE_APP_SERVER_URL + '/api/comment/danmaku/',
|
|
|
- token: 'tnbapp'
|
|
|
},
|
|
|
- getUrl: true
|
|
|
+ getUrl: true,
|
|
|
+ userToken: null
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ this.userToken = getAccessToken()
|
|
|
+ this.danmaku.token = this.userToken
|
|
|
},
|
|
|
mounted() {
|
|
|
const videoId = this.videoProp.videoId
|
|
|
@@ -42,8 +44,7 @@ export default {
|
|
|
videoUrl(videoId).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
var event = false
|
|
|
- const token = getAccessToken()
|
|
|
- if (token != null) {
|
|
|
+ if (this.userToken != null) {
|
|
|
SocketInstance.connect()
|
|
|
event = true
|
|
|
}
|
|
|
@@ -101,8 +102,7 @@ export default {
|
|
|
id: videoId,
|
|
|
maximum: 10000,
|
|
|
api: this.danmaku.api,
|
|
|
- token: this.danmaku.token,
|
|
|
- user: userId,
|
|
|
+ token: this.userToken,
|
|
|
bottom: '15%',
|
|
|
unlimited: true
|
|
|
}
|