mirror of
https://github.com/tickstep/aliyunpan.git
synced 2025-01-23 22:42:15 +08:00
add url escape method
This commit is contained in:
parent
2cdbf64b7a
commit
43686488a6
@ -19,6 +19,7 @@ import (
|
||||
"github.com/tickstep/aliyunpan/internal/config"
|
||||
"github.com/tickstep/library-go/logger"
|
||||
"math/rand"
|
||||
"net/url"
|
||||
"path"
|
||||
"strings"
|
||||
"time"
|
||||
@ -105,3 +106,14 @@ func GetAllPathFolderByPath(pathStr string) []string {
|
||||
}
|
||||
return dirs
|
||||
}
|
||||
|
||||
// EscapeStr 转义字符串
|
||||
func EscapeStr(s string) string {
|
||||
return url.PathEscape(s)
|
||||
}
|
||||
|
||||
// UnescapeStr 反转义字符串
|
||||
func UnescapeStr(s string) string {
|
||||
r,_ := url.PathUnescape(s)
|
||||
return r
|
||||
}
|
Loading…
Reference in New Issue
Block a user