解决图库打不开问题

Signed-off-by: nobbo <gaoshang22@huawei.com>
This commit is contained in:
nobbo
2023-11-06 16:02:23 +08:00
parent 3a3ee6640a
commit 2d37bcf432
2 changed files with 2 additions and 1 deletions
@@ -200,7 +200,7 @@ export struct NoteContentCompPortrait {
"ohos.permission.READ_MEDIA",
"ohos.permission.WRITE_MEDIA",
]
let context: any = getContext(this);
let context: any = AppStorage.Get("context");
let AtManager = abilityAccessCtrl.createAtManager();
// @ts-ignore
await AtManager.requestPermissionsFromUser(context, permissionList).then((data) => {
@@ -29,6 +29,7 @@ export default class MainAbility extends UIAbility {
private Tag = "MainAbility_Tablet"
onCreate(want, launchParam) {
AppStorage.SetOrCreate('context', this.context)
// @ts-ignore
window.getLastWindow(this.context, (err, data) => {
if (data && data.getWindowProperties()) {