From eef52f0975b7c0f1ac1293858e2a77e3f37120f2 Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Thu, 28 Jul 2022 09:46:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E8=8E=B7=E5=8F=96=E5=AD=97?= =?UTF-8?q?=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/cool/types/index.d.ts | 2 +- src/modules/dict/config.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) 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(); }); } };