Skip to content

Commit 80bfe50

Browse files
committed
feat: 发布v2.3.3
1 parent f235492 commit 80bfe50

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

internal/bootstrap/conf.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func initConf() {
2626

2727
func initGlobal() {
2828
app.Root = app.Conf.MustString("app.root")
29-
app.Version = "2.3.2"
29+
app.Version = "2.3.3"
3030
app.Locale = app.Conf.MustString("app.locale")
3131

3232
// 初始化时区

internal/route/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func Http(r chi.Router) {
217217
r.Get("/content", file.Content)
218218
r.Post("/save", file.Save)
219219
r.Post("/delete", file.Delete)
220-
r.Post("/upload", file.Upload) // TODO fix
220+
r.Post("/upload", file.Upload)
221221
r.Post("/move", file.Move)
222222
r.Post("/copy", file.Copy)
223223
r.Get("/download", file.Download)

internal/service/backup.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ func (s *BackupService) Upload(w http.ResponseWriter, r *http.Request) {
6262
}
6363

6464
_, handler, err := r.FormFile("file")
65+
if err != nil {
66+
Error(w, http.StatusInternalServerError, "上传文件失败:%v", err)
67+
return
68+
}
6569
path, err := s.backupRepo.GetPath(biz.BackupType(r.FormValue("type")))
6670
if err != nil {
6771
Error(w, http.StatusInternalServerError, "%v", err)

internal/service/file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (s *FileService) Upload(w http.ResponseWriter, r *http.Request) {
128128
path := r.FormValue("path")
129129
_, handler, err := r.FormFile("file")
130130
if err != nil {
131-
Error(w, http.StatusInternalServerError, "%v", err)
131+
Error(w, http.StatusInternalServerError, "上传文件失败:%v", err)
132132
return
133133
}
134134
if io.Exists(path) {

internal/service/file_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (s *FileService) Upload(w http.ResponseWriter, r *http.Request) {
128128
path := r.FormValue("path")
129129
_, handler, err := r.FormFile("file")
130130
if err != nil {
131-
Error(w, http.StatusInternalServerError, "%v", err)
131+
Error(w, http.StatusInternalServerError, "上传文件失败:%v", err)
132132
return
133133
}
134134
if io.Exists(path) {

0 commit comments

Comments
 (0)