mirror of
https://github.com/tickstep/aliyunpan.git
synced 2025-02-03 05:47:16 +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/aliyunpan/internal/config"
|
||||||
"github.com/tickstep/library-go/logger"
|
"github.com/tickstep/library-go/logger"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"net/url"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -105,3 +106,14 @@ func GetAllPathFolderByPath(pathStr string) []string {
|
|||||||
}
|
}
|
||||||
return dirs
|
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