mirror of
https://github.com/tickstep/aliyunpan.git
synced 2025-02-02 21:27: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/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"
|
||||||
@ -104,4 +105,15 @@ func GetAllPathFolderByPath(pathStr string) []string {
|
|||||||
dirs = append(dirs, p)
|
dirs = append(dirs, p)
|
||||||
}
|
}
|
||||||
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