fix(files): use name as home dir

This commit is contained in:
hexxa 2021-08-14 09:59:17 +08:00 committed by Hexxa
parent b6000771d7
commit 7b2c185686
5 changed files with 49 additions and 45 deletions

View file

@ -128,16 +128,16 @@ func ErrResp(c *gin.Context, code int, err error) (int, interface{}) {
}
func FsRootPath(userID, relFilePath string) string {
return filepath.Join(userID, FsRootDir, relFilePath)
func FsRootPath(userName, relFilePath string) string {
return filepath.Join(userName, FsRootDir, relFilePath)
}
func UploadPath(userID, relFilePath string) string {
return filepath.Join(UploadFolder(userID), fmt.Sprintf("%x", sha1.Sum([]byte(relFilePath))))
func UploadPath(userName, relFilePath string) string {
return filepath.Join(UploadFolder(userName), fmt.Sprintf("%x", sha1.Sum([]byte(relFilePath))))
}
func UploadFolder(userID string) string {
return filepath.Join(userID, UploadDir)
func UploadFolder(userName string) string {
return filepath.Join(userName, UploadDir)
}
func GetUserInfo(tokenStr string, tokenEncDec cryptoutil.ITokenEncDec) (map[string]string, error) {