You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
361 B
19 lines
361 B
package utils
|
|
|
|
import (
|
|
"encoding/json"
|
|
"log"
|
|
)
|
|
|
|
// ParseJson 将json字符串解析为map
|
|
func ParseJson(jsonStr string) map[string]any {
|
|
var wecomResponse map[string]any
|
|
if string(jsonStr) != "" {
|
|
err := json.Unmarshal([]byte(string(jsonStr)), &wecomResponse)
|
|
if err != nil {
|
|
log.Println("生成json字符串错误")
|
|
}
|
|
}
|
|
return wecomResponse
|
|
}
|