mirror of https://github.com/cloudreve/Cloudreve
Update policy.go
parent
6fa85d6cf7
commit
56e4046ef1
|
@ -125,6 +125,9 @@ func (m *Migrator) migratePolicy() (map[int]bool, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !hasRandomElement {
|
if !hasRandomElement {
|
||||||
|
if policy.DirNameRule == "" {
|
||||||
|
policy.DirNameRule = "uploads/{uid}/{path}"
|
||||||
|
}
|
||||||
policy.FileNameRule = "{uid}_{randomkey8}_{originname}"
|
policy.FileNameRule = "{uid}_{randomkey8}_{originname}"
|
||||||
m.l.Warning("Storage policy %q has no random element in file name rule, using default file name rule.", policy.Name)
|
m.l.Warning("Storage policy %q has no random element in file name rule, using default file name rule.", policy.Name)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue