Skip to content

Commit

Permalink
修复弹幕发送
Browse files Browse the repository at this point in the history
  • Loading branch information
mscststs committed Feb 8, 2019
1 parent 8301d31 commit 30eb71f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/electron/renderer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bls",
"version": "0.1.10",
"version": "0.1.11",
"author": "十字 <mscststs@qq.com>",
"description": "Bilibili Live Super",
"license": null,
Expand Down
14 changes: 13 additions & 1 deletion src/renderer/components/stocks/Custom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@ export default {
}
}
},
getCsrfToken(cookies){
for(let t of cookies){
if(t.name == "bili_jct"){
return t.value;
}
}
return "";
},
async DanmakuSend() {
if (
this.custom.selected.length !== 0 &&
Expand All @@ -246,6 +254,7 @@ export default {
for (let user of this.users) {
if (this.custom.selected.indexOf(user.name) >= 0) {
let csrftoken = this.getCsrfToken(user.cookies.cookies);
await this.$api.use(user).send(
"msg/send",
{
Expand All @@ -254,7 +263,10 @@ export default {
mode: 1,
msg: content,
rnd: Date.parse(new Date()) / 1000,
roomid: roomid
roomid: roomid,
bubble: 0,
csrf_token:csrftoken,
csrf:csrftoken,
},
"post"
);
Expand Down

0 comments on commit 30eb71f

Please sign in to comment.