同步获取字典

This commit is contained in:
icssoa 2022-07-28 09:46:53 +08:00
parent dc59513f30
commit eef52f0975
3 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "front-next", "name": "front-next",
"version": "5.7.2", "version": "5.7.3",
"scripts": { "scripts": {
"dev": "vite --host", "dev": "vite --host",
"build": "vite build", "build": "vite build",

View File

@ -13,7 +13,7 @@ export declare interface ModuleConfig {
onLoad?(events: { onLoad?(events: {
hasToken: (cb: () => Promise<any> | void) => Promise<any> | void; hasToken: (cb: () => Promise<any> | void) => Promise<any> | void;
[key: string]: any; [key: string]: any;
}): Promise<{ [key: string]: any }> | void; }): Promise<{ [key: string]: any }> | Promise<void> | void;
} }
export declare interface Module extends ModuleConfig { export declare interface Module extends ModuleConfig {

View File

@ -3,11 +3,11 @@ import { useDict } from "./index";
export default (): ModuleConfig => { export default (): ModuleConfig => {
return { return {
onLoad({ hasToken }) { async onLoad({ hasToken }) {
const { dict } = useDict(); const { dict } = useDict();
hasToken(() => { await hasToken(async () => {
dict.refresh(); await dict.refresh();
}); });
} }
}; };