build: 1.3.5-beta32

This commit is contained in:
手瓜一十雪 committed 2024-05-18 12:56:03 +08:00
1 parent d6175acd38
commit 44974034ec
15 files changed
+176 -79

No files matched your search

+11 -5
View File
@@ -4,17 +4,23 @@ import { friends } from '@/core/data';
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
import { NTQQFriendApi } from '@/core';
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
interface Payload{
no_cache: boolean | string
}
// no_cache get时传字符串
const SchemaData = {
type: 'object',
properties: {
no_cache: { type: 'boolean' },
}
} as const satisfies JSONSchema;
type Payload = FromSchema<typeof SchemaData>;
export default class GetFriendList extends BaseAction<Payload, OB11User[]> {
actionName = ActionName.GetFriendList;
PayloadSchema = SchemaData;
protected async _handle(payload: Payload) {
if (friends.size === 0 || 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)
if (_friends.length > 0) {