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:
@@ -102,6 +102,7 @@ solid #e9e9e9;"bgcolor="#fff"><tbody><tr style="font-family: 'Helvetica Neue',He
|
||||
{Name: "oss_timeout", Value: `3600`, Type: "timeout"},
|
||||
{Name: "archive_timeout", Value: `30`, Type: "timeout"},
|
||||
{Name: "download_timeout", Value: `30`, Type: "timeout"},
|
||||
{Name: "preview_timeout", Value: `60`, Type: "timeout"},
|
||||
{Name: "doc_preview_timeout", Value: `60`, Type: "timeout"},
|
||||
{Name: "upload_credential_timeout", Value: `1800`, Type: "timeout"},
|
||||
{Name: "upload_session_timeout", Value: `86400`, Type: "timeout"},
|
||||
|
||||
@@ -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