From 4c72fc5ac3164568ea7d33454e8f6bf5cd3b47ba Mon Sep 17 00:00:00 2001 From: "453530270@qq.com" Date: Wed, 10 Jul 2024 16:01:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4hash=20=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fssc/internal/handler/webconsole.go | 20 ++------------------ fssc/web/wbconsole.tmpl | 2 +- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/fssc/internal/handler/webconsole.go b/fssc/internal/handler/webconsole.go index fd55968..3f896a1 100644 --- a/fssc/internal/handler/webconsole.go +++ b/fssc/internal/handler/webconsole.go @@ -3,7 +3,6 @@ package handler import ( "fmt" "fssc/config" - "fssc/internal/db" "fssc/internal/util" "fssc/web" "html/template" @@ -19,7 +18,7 @@ func WebConsole(w http.ResponseWriter, r *http.Request) { // 路径 urlpath := r.URL.Query().Get("p") if urlpath == "Li4=" { - urlpath = "" + urlpath = "." } //文件名 @@ -43,7 +42,7 @@ func WebConsole(w http.ResponseWriter, r *http.Request) { realFilePath := filepath.Join(config.G.FilePath, abupath) downloadPath := filepath.Join(filepath.Base(config.G.FilePath), abupath) // 相对路径 - relpath := filepath.Join(abupath, "../") + relpath := filepath.Join(abupath, ".") fmt.Printf("relpath is %s\n", relpath) // fileInfo, err := os.Stat(realFilePath) @@ -81,21 +80,6 @@ func WebConsole(w http.ResponseWriter, r *http.Request) { return } data.Files = files - // 计算文件的hash和其他信息 - for _, f := range files { - // 结构体信息 - tf := db.StFileInfo{} - tf.Fname = f.Name() - tf.Fpath = filepath.Join(relpath, f.Name()) - // 文件的hash - tf.Fhash = util.CalacHash(f.Name()) - //add - ret := db.Sqlite_add(tf) - fmt.Printf("add ST-FileInfo is:%d\n", ret) - //log.Fatalln("add ST-FileInfo is:%d\n",ret) - - } - } else { data.FileName = filepath.Base(realFilePath) } diff --git a/fssc/web/wbconsole.tmpl b/fssc/web/wbconsole.tmpl index 51da4ee..3c082e6 100644 --- a/fssc/web/wbconsole.tmpl +++ b/fssc/web/wbconsole.tmpl @@ -211,7 +211,7 @@ } if(v.isbackup==1){ - html+="
"; + html+="
"; }else { html+="
"; }