This commit is contained in:
idranme
2024-08-28 04:48:07 +08:00
parent bc3c8b1259
commit 5501980ab3
95 changed files with 2115 additions and 2069 deletions

View File

@@ -2,7 +2,6 @@ import BaseAction from '../BaseAction'
import { OB11User } from '../../types'
import { OB11Constructor } from '../../constructor'
import { ActionName } from '../types'
import { NTQQFriendApi } from '@/ntqqapi/api'
import { getBuildVersion } from '@/common/utils/QQBasicInfo'
interface Payload {
@@ -15,9 +14,9 @@ export class GetFriendList extends BaseAction<Payload, OB11User[]> {
protected async _handle(payload: Payload) {
const refresh = payload?.no_cache === true || payload?.no_cache === 'true'
if (getBuildVersion() >= 26702) {
return OB11Constructor.friendsV2(await NTQQFriendApi.getBuddyV2(refresh))
return OB11Constructor.friendsV2(await this.ctx.ntFriendApi.getBuddyV2(refresh))
}
return OB11Constructor.friends(await NTQQFriendApi.getFriends(refresh))
return OB11Constructor.friends(await this.ctx.ntFriendApi.getFriends(refresh))
}
}
@@ -28,7 +27,7 @@ export class GetFriendWithCategory extends BaseAction<void, any> {
protected async _handle(payload: void) {
if (getBuildVersion() >= 26702) {
//全新逻辑
return OB11Constructor.friendsV2(await NTQQFriendApi.getBuddyV2ExWithCate(true))
return OB11Constructor.friendsV2(await this.ctx.ntFriendApi.getBuddyV2ExWithCate(true))
} else {
throw new Error('this ntqq version not support, must be 26702 or later')
}