From 2f4e5bf9d534c1eef12faa84687d0841af8942a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BB=E6=8A=AB?= Date: Sun, 24 Dec 2023 13:49:57 +0800 Subject: [PATCH] fix(alias): unable to locate file in copy link --- server/handles/fsread.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/server/handles/fsread.go b/server/handles/fsread.go index 7c580f635e4..c7b6327b557 100644 --- a/server/handles/fsread.go +++ b/server/handles/fsread.go @@ -323,7 +323,7 @@ func FsGet(c *gin.Context) { } parentMeta, _ := op.GetNearestMeta(parentPath) thumb, _ := model.GetThumb(obj) - common.SuccessResp(c, FsGetResp{ + fsresp := FsGetResp{ ObjResp: ObjResp{ Name: obj.GetName(), Size: obj.GetSize(), @@ -332,7 +332,6 @@ func FsGet(c *gin.Context) { Created: obj.CreateTime(), HashInfoStr: obj.GetHash().String(), HashInfo: obj.GetHash().Export(), - Sign: common.Sign(obj, parentPath, isEncrypt(meta, reqPath)), Type: utils.GetFileType(obj.GetName()), Thumb: thumb, }, @@ -341,7 +340,14 @@ func FsGet(c *gin.Context) { Header: getHeader(meta, reqPath), Provider: provider, Related: toObjsResp(related, parentPath, isEncrypt(parentMeta, parentPath)), - }) + } + if provider == "Alias" { + fsresp.Name = stdpath.Base(reqPath) + fsresp.Sign = sign.Sign(reqPath) + } else { + fsresp.Sign = common.Sign(obj, parentPath, isEncrypt(meta, reqPath)) + } + common.SuccessResp(c, fsresp) } func filterRelated(objs []model.Obj, obj model.Obj) []model.Obj {