!260 [缺陷]文件名解密错误

Merge pull request !260 from 王力量/day0828_fileName_weekly
This commit is contained in:
openharmony_ci 2024-08-29 03:15:04 +00:00 committed by Gitee
commit b186810544
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 2 deletions

View File

@ -215,7 +215,7 @@ struct changeEncryption {
let srcFileUri: string = GlobalContext.load('uri'); let srcFileUri: string = GlobalContext.load('uri');
let srcFileMsg: FileMsg = FileUtils.getAllSuffixByUri(srcFileUri); let srcFileMsg: FileMsg = FileUtils.getAllSuffixByUri(srcFileUri);
let documentSaveOptions = new picker.DocumentSaveOptions(); let documentSaveOptions = new picker.DocumentSaveOptions();
documentSaveOptions.newFileNames = [plaintextFile]; documentSaveOptions.newFileNames = [decodeURIComponent(plaintextFile)];
documentSaveOptions.fileSuffixChoices = [`.${srcFileMsg.fileType}`]; documentSaveOptions.fileSuffixChoices = [`.${srcFileMsg.fileType}`];
documentSaveOptions.defaultFilePathUri = srcFileUri.substring(0, documentSaveOptions.defaultFilePathUri = srcFileUri.substring(0,
srcFileUri.length - srcFileMsg.fileType.length - srcFileMsg.fileName.length - 5); srcFileUri.length - srcFileMsg.fileType.length - srcFileMsg.fileName.length - 5);

View File

@ -363,7 +363,7 @@ struct DlpDialog {
AppStorage.setOrCreate('hiFileType', srcFileMsg.fileType); AppStorage.setOrCreate('hiFileType', srcFileMsg.fileType);
let documentSaveOptions = new picker.DocumentSaveOptions(); let documentSaveOptions = new picker.DocumentSaveOptions();
displayName = displayName + '.dlp'; displayName = displayName + '.dlp';
documentSaveOptions.newFileNames = [decodeURI(srcFileMsg.fileName)]; documentSaveOptions.newFileNames = [decodeURIComponent(srcFileMsg.fileName)];
documentSaveOptions.fileSuffixChoices = [srcFileMsg.fileType + '.dlp']; documentSaveOptions.fileSuffixChoices = [srcFileMsg.fileType + '.dlp'];
documentSaveOptions.defaultFilePathUri = srcFileUri.substring(0, documentSaveOptions.defaultFilePathUri = srcFileUri.substring(0,
srcFileUri.length - srcFileMsg.fileType.length - srcFileMsg.fileName.length); srcFileUri.length - srcFileMsg.fileType.length - srcFileMsg.fileName.length);