Skip to content

Commit 4e3f1b8

Browse files
committed
fix(wecom): oauth access raw data
1 parent 1b30284 commit 4e3f1b8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/zh/wecom/web-auth.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ log.Println("avatar", user.GetAvatar())
8585

8686
// 由于我们的user接口可能遗漏某些字段的获取方法,所以你可以通过 user.GetRaw() 获取一个HashMap,
8787
// 这个和之前的user.GetID()效果是一样的
88-
log.Println("userID", user.GetRaw()["userID"])
88+
rawData, err := user.GetRaw()
89+
log.Println("position", (*rawData))["position"])
90+
91+
// 也可以使用collection的属性
92+
log.Println("position", user.Attributes["position"]))
93+
8994
```
9095

9196
::: tip

0 commit comments

Comments
 (0)