mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: file upload handler
This commit is contained in:
@@ -2,6 +2,7 @@ package util
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// RandStringRunes 返回随机字符串
|
||||
@@ -34,3 +35,11 @@ func ContainsString(s []string, e string) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Replace 根据替换表执行批量替换
|
||||
func Replace(table map[string]string, s string) string {
|
||||
for key, value := range table {
|
||||
s = strings.Replace(s, key, value, -1)
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user