删除应用内的临时dlp文件

Signed-off-by: li-li-wang <wangliliang5@huawei.com>
This commit is contained in:
li-li-wang 2024-06-11 14:22:21 +08:00
parent 2d7e0c68ca
commit 41565abe97
3 changed files with 30 additions and 8 deletions

View File

@ -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() {

View File

@ -103,6 +103,11 @@
"ohos.want.action.sendData"
],
"uris": [
{
"scheme": "file",
"utd": "general.file",
"maxFileSupported": 1
},
{
"scheme": "file",
"utd": "general.plain-text",

View File

@ -116,6 +116,11 @@
"ohos.want.action.sendData"
],
"uris": [
{
"scheme": "file",
"utd": "general.file",
"maxFileSupported": 1
},
{
"scheme": "file",
"utd": "general.plain-text",