mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 09:34:31 +08:00
修复识别系统默认语言
This commit is contained in:
@@ -8,11 +8,13 @@ import path from 'path';
|
||||
export enum EKeyv {
|
||||
'apps' = 'apps',
|
||||
'authInfo' = 'authInfo',
|
||||
'lang' = 'lang',
|
||||
}
|
||||
|
||||
export interface IKeyvStore {
|
||||
apps: App[];
|
||||
authInfo: AuthInfo;
|
||||
lang: string;
|
||||
}
|
||||
|
||||
const keyvSqlite = new KeyvSqlite(path.join(config.dbPath, 'keyv.sqlite'));
|
||||
@@ -31,4 +33,10 @@ export const shareStore = {
|
||||
updateApps(apps: App[]) {
|
||||
return keyvStore.set<IKeyvStore['apps']>(EKeyv.apps, apps);
|
||||
},
|
||||
getLang() {
|
||||
return keyvStore.get<IKeyvStore['lang']>(EKeyv.lang);
|
||||
},
|
||||
setLang(value: IKeyvStore['lang']) {
|
||||
return keyvStore.set<IKeyvStore['lang']>(EKeyv.lang, value);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user