优化代码

This commit is contained in:
GoEdgeLab
2022-03-22 22:11:32 +08:00
parent 1e4143bcbb
commit 3c3adf421a
68 changed files with 148 additions and 148 deletions

View File

@@ -27,7 +27,7 @@ func (this *FileService) FindEnabledFile(ctx context.Context, req *pb.FindEnable
return &pb.FindEnabledFileResponse{File: nil}, nil
}
if file.IsPublic != 1 {
if !file.IsPublic {
// 校验权限
if userId > 0 && int64(file.UserId) != userId {
return nil, this.PermissionError()
@@ -40,7 +40,7 @@ func (this *FileService) FindEnabledFile(ctx context.Context, req *pb.FindEnable
Filename: file.Filename,
Size: int64(file.Size),
CreatedAt: int64(file.CreatedAt),
IsPublic: file.IsPublic == 1,
IsPublic: file.IsPublic,
},
}, nil
}