node-webot / co-wechat-api

Wechat API. Support Async Functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getToken 函数的调用应该传入当前的 appid

mytharcher opened this issue · comments

commented

at line 202:

var token = await this.getToken() => var token = await this.getToken(this.appid)

这样在一个系统维护多个 api 时,可以知道是哪个 api 的缓存被调用了,否则这个函数的实现必须针对每个 api 都用闭包来包装。

commented

发现可以在函数内通过 this.appid 取得,但还是建议加上,避免传入函数的 this 被改变。