feat: 添加群名片支持
This commit is contained in:
parent
2fccf24709
commit
be37dcc1fd
@ -128,6 +128,21 @@ func parseQQDocURL(jsonStr string) (string, error) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
return "", fmt.Errorf("找不到 jumpUrl 字段")
|
return "", fmt.Errorf("找不到 jumpUrl 字段")
|
||||||
}
|
}
|
||||||
|
} else if jsonData["app"] == "com.tencent.troopsharecard" { // 定位到 meta -> contact -> jumpUrl
|
||||||
|
meta, ok := jsonData["meta"].(map[string]interface{})
|
||||||
|
if !ok {
|
||||||
|
return "", fmt.Errorf("找不到 meta 字段")
|
||||||
|
}
|
||||||
|
contact, ok := meta["contact"].(map[string]interface{})
|
||||||
|
if !ok {
|
||||||
|
return "", fmt.Errorf("找不到 contact 字段")
|
||||||
|
}
|
||||||
|
url, ok = contact["jumpUrl"].(string)
|
||||||
|
if !ok {
|
||||||
|
return "", fmt.Errorf("找不到 jumpUrl 字段")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return "", fmt.Errorf("未知的 app 类型")
|
||||||
}
|
}
|
||||||
|
|
||||||
return url, nil
|
return url, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user