diff --git a/package.json b/package.json index 5f7a8c4..9f274fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "front-next", - "version": "5.7.2", + "version": "5.7.3", "scripts": { "dev": "vite --host", "build": "vite build", diff --git a/src/cool/types/index.d.ts b/src/cool/types/index.d.ts index 4d5d7c7..73a982e 100644 --- a/src/cool/types/index.d.ts +++ b/src/cool/types/index.d.ts @@ -13,7 +13,7 @@ export declare interface ModuleConfig { onLoad?(events: { hasToken: (cb: () => Promise | void) => Promise | void; [key: string]: any; - }): Promise<{ [key: string]: any }> | void; + }): Promise<{ [key: string]: any }> | Promise | void; } export declare interface Module extends ModuleConfig { diff --git a/src/modules/dict/config.ts b/src/modules/dict/config.ts index 78f036c..24ddf36 100644 --- a/src/modules/dict/config.ts +++ b/src/modules/dict/config.ts @@ -3,11 +3,11 @@ import { useDict } from "./index"; export default (): ModuleConfig => { return { - onLoad({ hasToken }) { + async onLoad({ hasToken }) { const { dict } = useDict(); - hasToken(() => { - dict.refresh(); + await hasToken(async () => { + await dict.refresh(); }); } };