Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhangbo1_wd
2024-05-20 17:42:35 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5561369784744fe0f180ed9aa5900618600bc21f
55613697
1 parent
4b74474e
切环境,清除首页缓存
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
sight_harmony/commons/wdKit/src/main/ets/utils/KVStoreHelper.ets
sight_harmony/features/wdComponent/src/main/ets/components/setting/EnvironmentCustomDialog.ets
sight_harmony/commons/wdKit/src/main/ets/utils/KVStoreHelper.ets
View file @
5561369
...
...
@@ -89,6 +89,15 @@ export class KVStoreHelper {
}
}
deleteAll() {
this.kvManager?.deleteKVStore(AppUtils.getPackageName(getContext()), KVStoreHelper._default_store_id)
.then(() => {
Logger.error(TAG, 'deleteAll success')
}).catch((e: object) => {
Logger.error(TAG, 'deleteAll error: ' + JSON.stringify(e))
})
}
private checkStoreCreated() {
if (!this.kvManager) {
this.createKVManager()
...
...
sight_harmony/features/wdComponent/src/main/ets/components/setting/EnvironmentCustomDialog.ets
View file @
5561369
import { SPHelper } from 'wdKit/Index';
import {
KVStoreHelper,
SPHelper } from 'wdKit/Index';
import { HostEnum, HostManager, HttpUrlUtils } from 'wdNetwork/Index';
@CustomDialog
...
...
@@ -86,10 +86,15 @@ export struct EnvironmentCustomDialog {
Button('确认')
.margin({ top: 20 })
.onClick(() => {
// HttpUrlUtils.hostUrl = this.currentEnvironment
SPHelper.default.saveSync('hostUrl', this.currentEnvironment);
this.controller.close()
this.confirm()
new Promise<void>(() => {
// HttpUrlUtils.hostUrl = this.currentEnvironment
SPHelper.default.saveSync('hostUrl', this.currentEnvironment);
// 清首页缓存
KVStoreHelper.default.deleteAll()
// TODO 清sp相关
this.controller.close()
this.confirm()
})
})
}.height(261).backgroundColor(Color.White).borderRadius(6).width('74%')
...
...
Please
register
or
login
to post a comment