settingsdata支持多用户独立配置

Signed-off-by: 侯志雄 <houzhixiong1@h-partners.com>
This commit is contained in:
侯志雄 2024-06-25 17:14:36 +08:00
parent 8a8e392fd5
commit 9de87406d4

View File

@ -72,7 +72,7 @@ class SettingsDBHelper {
private constructor() {
this.rdbStore = undefined;
this.context = GlobalContext.thisContext as Context;
this.context = GlobalContext.getContext().getObject('abilityContext') as Context;
Log.info('context start'+ JSON.stringify(this.context));
}
@ -159,15 +159,14 @@ class SettingsDBHelper {
public async initRdbStore() {
Log.info('call initRdbStore start');
let rdbStore = await relationalStore.getRdbStore(
this.context as Context, { name: SettingsDataConfig.DB_NAME,securityLevel:1 });
let rdbStore = await relationalStore.getRdbStore(this.context as Context, {
name: SettingsDataConfig.DB_NAME,
securityLevel:1
});
if(rdbStore){
this.rdbStore = rdbStore;
}
await this.firstStartupConfig();
Log.info('call initRdbStore end');
return this.rdbStore;
}