|
@@ -27,15 +27,13 @@ func GetComplexRandom(n int) (randomStr string) {
|
|
|
func GetParams(url, name string) (stateValue string) {
|
|
|
// 定义正则表达式模式
|
|
|
pattern := name + `=([^&]+)`
|
|
|
-
|
|
|
// 编译正则表达式
|
|
|
regex := regexp.MustCompile(pattern)
|
|
|
-
|
|
|
// 执行正则匹配
|
|
|
match := regex.FindStringSubmatch(url)
|
|
|
|
|
|
if len(match) > 1 {
|
|
|
- stateValue := match[1]
|
|
|
+ stateValue = match[1]
|
|
|
fmt.Println("State value:", stateValue)
|
|
|
} else {
|
|
|
fmt.Println("State parameter not found")
|