fix: local storage dir

This commit is contained in:
Simon Ding
2024-07-30 16:12:10 +08:00
parent 6ef4bedebe
commit 88a554b186
3 changed files with 13 additions and 9 deletions

View File

@@ -85,10 +85,10 @@ func (l *LocalStorage) ReadDir(dir string) ([]fs.FileInfo, error) {
}
func (l *LocalStorage) ReadFile(name string) ([]byte, error) {
return os.ReadFile(name)
return os.ReadFile(filepath.Join(l.dir, name))
}
func (l *LocalStorage) WriteFile(name string, data []byte) error {
return os.WriteFile(name, data, os.ModePerm)
return os.WriteFile(filepath.Join(l.dir, name), data, os.ModePerm)
}