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 == "" {