From 41565abe97db4fb6f1ee39fd4c9e67b37820759d Mon Sep 17 00:00:00 2001 From: li-li-wang Date: Tue, 11 Jun 2024 14:22:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=BA=94=E7=94=A8=E5=86=85?= =?UTF-8?q?=E7=9A=84=E4=B8=B4=E6=97=B6dlp=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-li-wang --- entry/src/main/ets/pages/encryptedSharing.ets | 28 +++++++++++++------ entry/src/main/module.json | 5 ++++ entry/src/main/module.json5 | 5 ++++ 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/entry/src/main/ets/pages/encryptedSharing.ets b/entry/src/main/ets/pages/encryptedSharing.ets index ef7ffe7..acb4497 100644 --- a/entry/src/main/ets/pages/encryptedSharing.ets +++ b/entry/src/main/ets/pages/encryptedSharing.ets @@ -17,6 +17,7 @@ import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSessi import { EditableLeftIconType } from '@ohos.arkui.advanced.EditableTitleBar'; import { EditableTitleBar } from '@ohos.arkui.advanced.EditableTitleBar'; import ConnectService from '../common/share/ConnectService'; +import { KeyboardAvoidMode } from '@ohos.arkui.UIContext'; import dlpPermission from '@ohos.dlpPermission'; import promptAction from '@ohos.promptAction'; import Want from '@ohos.app.ability.Want'; @@ -40,6 +41,13 @@ class Test { public '4': string = ''; } +class AuthUserList { + public authAccount: string = ''; + public authAccountType: number = 0; + public dlpFileAccess: number = 0; + public permExpiryTime: number = 0; +} + let defaultDlpProperty: dlpPermission.DLPProperty = { ownerAccount: '', ownerAccountType: dlpPermission.AccountType.CLOUD_ACCOUNT, @@ -222,18 +230,19 @@ struct encryptedSharing { AppStorage.setOrCreate('isInputInvalid', ''); return false; } + let authUserList: AuthUserList[] = [ + { + 'authAccount': credentialCallBack.userIdCipher, + 'authAccountType': 1, + 'dlpFileAccess': 1, + 'permExpiryTime': Date.UTC(9999, 1, 1), + } + ]; this.dlpProperty = { 'ownerAccount': this.ownerAccount, 'ownerAccountID': this.ownerAccountID, 'ownerAccountType': 1, - 'authUserList': [ - { - 'authAccount': credentialCallBack.userIdCipher, - 'authAccountType': 1, - 'dlpFileAccess': 1, - 'permExpiryTime': Date.UTC(9999, 1, 1), - } - ], + 'authUserList': authUserList, 'contactAccount': this.ownerAccount, 'offlineAccess': true, } @@ -251,6 +260,9 @@ struct encryptedSharing { AppStorage.setOrCreate('hiAccountType', dlpPermission.AccountType.CLOUD_ACCOUNT); sendDlpManagerAccountLogin(-1); this.checkContacts(); + let pathDir = getContext(this).filesDir; + fs.rmdirSync(pathDir); + this.getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE); } build() { diff --git a/entry/src/main/module.json b/entry/src/main/module.json index 4b636c1..f055951 100644 --- a/entry/src/main/module.json +++ b/entry/src/main/module.json @@ -103,6 +103,11 @@ "ohos.want.action.sendData" ], "uris": [ + { + "scheme": "file", + "utd": "general.file", + "maxFileSupported": 1 + }, { "scheme": "file", "utd": "general.plain-text", diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 index 2d08322..88da1d3 100644 --- a/entry/src/main/module.json5 +++ b/entry/src/main/module.json5 @@ -116,6 +116,11 @@ "ohos.want.action.sendData" ], "uris": [ + { + "scheme": "file", + "utd": "general.file", + "maxFileSupported": 1 + }, { "scheme": "file", "utd": "general.plain-text",