mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-29 05:24:30 +08:00
fix: 弹幕点赞
This commit is contained in:
1 parent
f2fecbb6c6
commit
75acb376e2
2 files changed
+28
-6
No files matched your search
@@ -26,6 +26,7 @@ interface DanmakuInfo {
|
||||
comment: string;
|
||||
tags: string;
|
||||
love: number;
|
||||
my_love_type: boolean;
|
||||
}
|
||||
|
||||
interface DanmakuPostInfo extends Partial<DanmakuContentInfo> {
|
||||
@@ -379,7 +380,11 @@ export class Danmaku extends EventEmitter<DanmakuEvent> {
|
||||
id: this.id
|
||||
};
|
||||
|
||||
const res = await axios.post<PostLikeResponse>(Danmaku.backend, post);
|
||||
const form = toFormData(post);
|
||||
/* @__PURE__ */ form.append('userid', id);
|
||||
/* @__PURE__ */ form.append('password', password);
|
||||
|
||||
const res = await axios.post<PostLikeResponse>(Danmaku.backend, form);
|
||||
if (res.data.code !== 0) {
|
||||
logger.severe(
|
||||
2,
|
||||
@@ -451,6 +456,8 @@ export class Danmaku extends EventEmitter<DanmakuEvent> {
|
||||
* 拉取本塔所有弹幕
|
||||
*/
|
||||
static async fetch() {
|
||||
Danmaku.all.clear();
|
||||
Danmaku.allInPos = {};
|
||||
const form = toFormData({
|
||||
type: 1,
|
||||
towername: 'HumanBreak'
|
||||
@@ -463,6 +470,7 @@ export class Danmaku extends EventEmitter<DanmakuEvent> {
|
||||
const dan = new Danmaku();
|
||||
dan.id = v.id;
|
||||
dan.likedNum = v.love;
|
||||
dan.liked = v.my_love_type;
|
||||
dan.decode(v);
|
||||
dan.posted = true;
|
||||
dan.addToList();
|
||||
|
||||
Reference in new issue
Block a user