mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 06:02:38 +08:00
同步获取字典
This commit is contained in:
parent
dc59513f30
commit
eef52f0975
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "front-next",
|
||||
"version": "5.7.2",
|
||||
"version": "5.7.3",
|
||||
"scripts": {
|
||||
"dev": "vite --host",
|
||||
"build": "vite build",
|
||||
|
2
src/cool/types/index.d.ts
vendored
2
src/cool/types/index.d.ts
vendored
@ -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 {
|
||||
|
@ -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();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user