mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
♻️ 重构收藏数据库,更加beauty
This commit is contained in:
@@ -35,6 +35,7 @@ const TGRequest = {
|
||||
User: {
|
||||
getAuthkey: genAuthkey,
|
||||
getAuthkey2: genAuthkey2,
|
||||
getCollect: getUserCollect,
|
||||
getGachaLog,
|
||||
getRecord: getGameRecord,
|
||||
byLoginTicket: {
|
||||
@@ -44,7 +45,6 @@ const TGRequest = {
|
||||
getAbyss,
|
||||
getAccounts: getGameAccountsByCookie,
|
||||
getUserInfo: getUserInfoByCookie,
|
||||
getCollect: getUserCollect,
|
||||
},
|
||||
byLToken: {
|
||||
verify: verifyLToken,
|
||||
|
||||
@@ -12,15 +12,17 @@ import TGUtils from "../utils/TGUtils";
|
||||
* @description 获取用户收藏帖子
|
||||
* @since Beta v0.4.5
|
||||
* @param {Record<string, string>} cookie - 用户 cookie
|
||||
* @param {string} uid - 用户 uid
|
||||
* @param {string} offset - 偏移量
|
||||
* @returns {Promise<TGApp.BBS.Collection.PostRespData|TGApp.BBS.Response.Base>} 用户收藏帖子
|
||||
*/
|
||||
export async function getUserCollect(
|
||||
cookie: Record<string, string>,
|
||||
uid: string,
|
||||
offset: string = "",
|
||||
): Promise<TGApp.BBS.Collection.PostRespData | TGApp.BBS.Response.Base> {
|
||||
const url = "https://bbs-api.miyoushe.com/post/wapi/userFavouritePost";
|
||||
const params = { size: "20", offset };
|
||||
const params = { size: "20", uid, offset };
|
||||
const header = TGUtils.User.getHeader(cookie, "GET", params, "common");
|
||||
return await http
|
||||
.fetch<TGApp.BBS.Collection.PostResponse | TGApp.BBS.Response.Base>(url, {
|
||||
|
||||
Reference in New Issue
Block a user