mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
build: 1.5.9 - refactor cache
This commit is contained in:
@@ -2,7 +2,6 @@ import { OB11Group } from '../../types';
|
|||||||
import { OB11Constructor } from '../../constructor';
|
import { OB11Constructor } from '../../constructor';
|
||||||
import BaseAction from '../BaseAction';
|
import BaseAction from '../BaseAction';
|
||||||
import { ActionName } from '../types';
|
import { ActionName } from '../types';
|
||||||
import { groups } from '@/core/data';
|
|
||||||
import { NTQQGroupApi } from '@/core/apis';
|
import { NTQQGroupApi } from '@/core/apis';
|
||||||
import { Group } from '@/core/entities';
|
import { Group } from '@/core/entities';
|
||||||
import { log } from '@/common/utils/log';
|
import { log } from '@/common/utils/log';
|
||||||
@@ -21,7 +20,7 @@ class GetGroupList extends BaseAction<Payload, OB11Group[]> {
|
|||||||
actionName = ActionName.GetGroupList;
|
actionName = ActionName.GetGroupList;
|
||||||
PayloadSchema = SchemaData;
|
PayloadSchema = SchemaData;
|
||||||
protected async _handle(payload: Payload) {
|
protected async _handle(payload: Payload) {
|
||||||
let groupList: Group[] = Array.from(groups.values());
|
let groupList: Group[] = await NTQQGroupApi.getGroups();
|
||||||
if (groupList.length === 0 || payload?.no_cache === true || payload.no_cache === 'true') {
|
if (groupList.length === 0 || payload?.no_cache === true || payload.no_cache === 'true') {
|
||||||
groupList = await NTQQGroupApi.getGroups(true);
|
groupList = await NTQQGroupApi.getGroups(true);
|
||||||
// log('get groups', groups);
|
// log('get groups', groups);
|
||||||
|
Reference in New Issue
Block a user