fix(189cloudpc): wrong modified time (close #910)

pull/938/head
Xhofe 2022-04-06 17:58:57 +08:00
parent 24d031d578
commit 5295593bf8
2 changed files with 5 additions and 4 deletions

View File

@ -229,7 +229,7 @@ func (driver Cloud189) Files(path string, account *model.Account) ([]model.File,
Size: 0,
Type: conf.FOLDER,
Driver: driver.Config().Name,
UpdatedAt: MustParseTime(folder.CreateDate),
UpdatedAt: MustParseTime(folder.LastOpTime),
})
}
for _, file := range resp.FileListAO.FileList {
@ -239,7 +239,7 @@ func (driver Cloud189) Files(path string, account *model.Account) ([]model.File,
Size: file.Size,
Type: utils.GetFileType(filepath.Ext(file.Name)),
Driver: driver.Config().Name,
UpdatedAt: MustParseTime(file.CreateDate),
UpdatedAt: MustParseTime(file.LastOpTime),
Thumbnail: file.Icon.SmallUrl,
})
}

View File

@ -144,8 +144,9 @@ func BoolToNumber(b bool) int {
}
func MustParseTime(str string) *time.Time {
time, _ := http.ParseTime(str)
return &time
loc, _ := time.LoadLocation("Local")
lastOpTime, _ := time.ParseInLocation("2006-01-02 15:04:05", str, loc)
return &lastOpTime
}
type Params map[string]string