Skip to content

Commit

Permalink
fix: 修复本地文件解密bug
Browse files Browse the repository at this point in the history
  • Loading branch information
traceless committed Feb 6, 2024
1 parent dfba560 commit a439f79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion enc-webui/src/views/encrypt-local/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<el-form-item label="密码">
<el-input v-model="folderForm.password" style="max-width: 260px; margin-right: 10px" placeholder="12341234" />
</el-form-item>
<el-form-item v-if="folderForm.operation == 'enc'" label="文件名">
<el-form-item label="文件名">
加密
<el-switch
v-model="folderForm.encName"
Expand Down
2 changes: 1 addition & 1 deletion node-proxy/src/utils/convertFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export async function encryptFile(
const newFileName = encodeName(password, encType, fileName) + ext
relativePath = path.join(childPath, newFileName)
}
if (enc === 'dec') {
if (enc === 'dec' && encName) {
const newFileName = decodeName(password, encType, ext !== '' ? fileName.substring(0, fileName.length - ext.length) : fileName)
if (newFileName) {
relativePath = path.join(childPath, newFileName)
Expand Down

0 comments on commit a439f79

Please sign in to comment.