同步获取字典

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",
"version": "5.7.2",
"version": "5.7.3",
"scripts": {
"dev": "vite --host",
"build": "vite build",

View File

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

View File

@ -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();
});
}
};