mirror of
https://github.com/shanmiteko/LotteryAutoScript.git
synced 2026-06-04 21:01:17 +08:00
fix: add promise
This commit is contained in:
parent
5654c745c6
commit
eb788f58be
@ -76,28 +76,31 @@ const BiliAPI = {
|
||||
/**
|
||||
* 删除at信息
|
||||
* @param {number} id
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
delAtinfo: async (id) => {
|
||||
Ajax.post({
|
||||
url: 'https://api.bilibili.com/x/msgfeed/del',
|
||||
hasCookies: true,
|
||||
dataType: 'application/x-www-form-urlencoded',
|
||||
data: {
|
||||
tp: 2,
|
||||
id,
|
||||
csrf: GlobalVar.csrf
|
||||
},
|
||||
success: responseText => {
|
||||
let res = Base.strToJson(responseText);
|
||||
if (res.code === 0) {
|
||||
console.log('删除at信息成功');
|
||||
resolve();
|
||||
} else {
|
||||
console.log(`删除at信息失败`);
|
||||
resolve();
|
||||
return new Promise((resolve) => {
|
||||
Ajax.post({
|
||||
url: 'https://api.bilibili.com/x/msgfeed/del',
|
||||
hasCookies: true,
|
||||
dataType: 'application/x-www-form-urlencoded',
|
||||
data: {
|
||||
tp: 2,
|
||||
id,
|
||||
csrf: GlobalVar.csrf
|
||||
},
|
||||
success: responseText => {
|
||||
let res = Base.strToJson(responseText);
|
||||
if (res.code === 0) {
|
||||
console.log('删除at信息成功');
|
||||
resolve();
|
||||
} else {
|
||||
console.log(`删除at信息失败`);
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取关注列表
|
||||
|
||||
Loading…
Reference in New Issue
Block a user