refactor: api getbuddyv2

This commit is contained in:
手瓜一十雪 committed 2024-08-04 16:05:07 +08:00
1 parent 3cce9f528b
commit 58f22b24e4
8 files changed
+78 -44

No files matched your search

+5 -1
View File
@@ -5,6 +5,7 @@ import BaseAction from '../BaseAction';
import { ActionName } from '../types';
import { NTQQFriendApi } from '@/core';
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
import { requireMinNTQQBuild } from '@/common/utils/QQBasicInfo';
// no_cache get时传字符串
@@ -20,7 +21,10 @@ export default class GetFriendList extends BaseAction<Payload, OB11User[]> {
actionName = ActionName.GetFriendList;
PayloadSchema = SchemaData;
protected async _handle(payload: Payload) {
//let data = await NTQQFriendApi.getBuddyV2(payload?.no_cache === true || payload?.no_cache=== 'true');
if (requireMinNTQQBuild('26702')) {
//全新逻辑
return OB11Constructor.friendsV2(await NTQQFriendApi.getBuddyV2(payload?.no_cache === true || payload?.no_cache === 'true'));
}
if (friends.size === 0 || payload?.no_cache === true || payload?.no_cache === 'true') {
const _friends = await NTQQFriendApi.getFriends(true);
// log('强制刷新好友列表,结果: ', _friends)