Skip to content

Commit

Permalink
feat: 发布v2.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Oct 13, 2024
1 parent f235492 commit 80bfe50
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/bootstrap/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func initConf() {

func initGlobal() {
app.Root = app.Conf.MustString("app.root")
app.Version = "2.3.2"
app.Version = "2.3.3"
app.Locale = app.Conf.MustString("app.locale")

// 初始化时区
Expand Down
2 changes: 1 addition & 1 deletion internal/route/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func Http(r chi.Router) {
r.Get("/content", file.Content)
r.Post("/save", file.Save)
r.Post("/delete", file.Delete)
r.Post("/upload", file.Upload) // TODO fix
r.Post("/upload", file.Upload)
r.Post("/move", file.Move)
r.Post("/copy", file.Copy)
r.Get("/download", file.Download)
Expand Down
4 changes: 4 additions & 0 deletions internal/service/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ func (s *BackupService) Upload(w http.ResponseWriter, r *http.Request) {
}

_, handler, err := r.FormFile("file")
if err != nil {
Error(w, http.StatusInternalServerError, "上传文件失败:%v", err)
return
}
path, err := s.backupRepo.GetPath(biz.BackupType(r.FormValue("type")))
if err != nil {
Error(w, http.StatusInternalServerError, "%v", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/service/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (s *FileService) Upload(w http.ResponseWriter, r *http.Request) {
path := r.FormValue("path")
_, handler, err := r.FormFile("file")
if err != nil {
Error(w, http.StatusInternalServerError, "%v", err)
Error(w, http.StatusInternalServerError, "上传文件失败:%v", err)
return
}
if io.Exists(path) {
Expand Down
2 changes: 1 addition & 1 deletion internal/service/file_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (s *FileService) Upload(w http.ResponseWriter, r *http.Request) {
path := r.FormValue("path")
_, handler, err := r.FormFile("file")
if err != nil {
Error(w, http.StatusInternalServerError, "%v", err)
Error(w, http.StatusInternalServerError, "上传文件失败:%v", err)
return
}
if io.Exists(path) {
Expand Down

0 comments on commit 80bfe50

Please sign in to comment.