mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Modify: Decide whether to redirect when previewing based on storage policy
This commit is contained in:
@@ -67,6 +67,12 @@ func GetPolicyByID(ID interface{}) (Policy, error) {
|
||||
return policy, result.Error
|
||||
}
|
||||
|
||||
// IsDirectlyPreview 返回此策略下文件是否可以直接预览(不需要重定向)
|
||||
// TODO 测试
|
||||
func (policy *Policy) IsDirectlyPreview() bool {
|
||||
return policy.Type == "local"
|
||||
}
|
||||
|
||||
// AfterFind 找到存储策略后的钩子
|
||||
func (policy *Policy) AfterFind() (err error) {
|
||||
// 解析存储策略设置到OptionsSerialized
|
||||
|
||||
Reference in New Issue
Block a user