From 662d1c57afdfbd1924a13c4d51d5615babdc4be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=AD=90=E6=97=BA?= <15039612+liu-ziwang123@user.noreply.gitee.com> Date: Mon, 11 Nov 2024 18:57:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- godo/files/fs.go | 2 +- godo/files/pwdfile.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/godo/files/fs.go b/godo/files/fs.go index 790cd2e..29c8dd6 100644 --- a/godo/files/fs.go +++ b/godo/files/fs.go @@ -317,7 +317,7 @@ func HandleCopyFile(w http.ResponseWriter, r *http.Request) { // 带加密写 func HandleWriteFile(w http.ResponseWriter, r *http.Request) { - filePath := r.URL.Query().Get("filePath") + filePath := r.URL.Query().Get("path") basePath, err := libs.GetOsDir() if err != nil { libs.HTTPError(w, http.StatusInternalServerError, err.Error()) diff --git a/godo/files/pwdfile.go b/godo/files/pwdfile.go index 8330440..c56b3a1 100644 --- a/godo/files/pwdfile.go +++ b/godo/files/pwdfile.go @@ -20,6 +20,7 @@ func HandleReadFile(w http.ResponseWriter, r *http.Request) { } // 非加密文件直接返回base64编码 isHide := IsHaveHiddenFile(basePath, path) + //Liuziwang888!@# if !isHide { fileContent, err := ReadFile(basePath, path) if err != nil { @@ -35,7 +36,7 @@ func HandleReadFile(w http.ResponseWriter, r *http.Request) { return } // 有隐藏文件说明这是一个加密过的文件,需要验证密码 - fPwd := r.Header.Get("filePwd") + fPwd := r.Header.Get("pwd") if fPwd == "" { libs.HTTPError(w, http.StatusBadRequest, "密码不能为空") return @@ -71,7 +72,7 @@ func HandleReadFile(w http.ResponseWriter, r *http.Request) { // 设置文件密码 func HandleSetFilePwd(w http.ResponseWriter, r *http.Request) { - fPwd := r.Header.Get("filePwd") + fPwd := r.Header.Get("filepwd") salt, err := GetSalt(r) // 获取盐值 // 处理获取盐值时的错误 if err != nil || fPwd == "" {