()
| 2 | |
| 3 | class WechatSender { |
| 4 | constructor() { |
| 5 | this.appid = process.env.WECHAT_APPID |
| 6 | this.secret = process.env.WECHAT_SECRET |
| 7 | |
| 8 | if (!this.appid || !this.secret) { |
| 9 | const errorMessage = |
| 10 | "Error: WECHAT_APPID or WECHAT_SECRET is not set in the environment variables" |
| 11 | console.error(errorMessage) |
| 12 | throw new Error(errorMessage) |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | async getAccessToken() { |
| 17 | const url = `https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${this.appid}&secret=${this.secret}` |
nothing calls this directly
no outgoing calls
no test coverage detected