1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-04 21:02:25 +08:00
Commit Graph

13 Commits

Author SHA1 Message Date
mahongran
9c87d1cb34 feat:企业微信客户端API JS-SDK wx.config 和 wx.agentConfig 方法权限签名 (#817)
* feat: enhance WorkAccessToken to include AgentID for improved token management

- Added AgentID field to WorkAccessToken struct.
- Updated NewWorkAccessToken function to accept AgentID as a parameter.
- Modified access token cache key to incorporate AgentID, ensuring unique cache entries per agent.

This change improves the handling of access tokens in a multi-agent environment.

* refactor: enhance WorkAccessToken to improve cache key handling

- Updated the AgentID field in WorkAccessToken struct to clarify its optional nature for distinguishing applications.
- Modified the access token cache key construction to support both new and legacy formats based on the presence of AgentID.
- Added comments for better understanding of the cache key logic and its compatibility with historical versions.

This change improves the flexibility and clarity of access token management in multi-agent scenarios.

* feat(work): add JsSdk method for JavaScript SDK integration

- Introduced a new JsSdk method in the Work struct to facilitate the creation of a Js instance.
- This addition enhances the functionality of the Work module by enabling JavaScript SDK support.

This change improves the integration capabilities for developers working with the WeChat Work API.

* fix gofmt
2025-01-14 10:52:24 +08:00
mahongran
71c8ab58fb F ix work access token (#810)
* feat: enhance WorkAccessToken to include AgentID for improved token management

- Added AgentID field to WorkAccessToken struct.
- Updated NewWorkAccessToken function to accept AgentID as a parameter.
- Modified access token cache key to incorporate AgentID, ensuring unique cache entries per agent.

This change improves the handling of access tokens in a multi-agent environment.

* refactor: enhance WorkAccessToken to improve cache key handling

- Updated the AgentID field in WorkAccessToken struct to clarify its optional nature for distinguishing applications.
- Modified the access token cache key construction to support both new and legacy formats based on the presence of AgentID.
- Added comments for better understanding of the cache key logic and its compatibility with historical versions.

This change improves the flexibility and clarity of access token management in multi-agent scenarios.

* feat: enhance WorkAccessToken with new constructor for AgentID support

- Introduced NewWorkAccessTokenWithAgentID function to maintain backward compatibility while allowing for AgentID usage.
- Updated NewWorkAccessToken to call the new constructor, ensuring seamless integration.
- Improved error handling in GetAccessTokenContext by checking for cache availability and handling potential errors during cache operations.

This change enhances the flexibility of access token management, particularly in multi-agent scenarios, while ensuring compatibility with existing implementations.
2025-01-07 22:19:21 +08:00
yangyl12345
a571bf3546 Update default_access_token.go (#805)
* Update default_access_token.go

微信获取稳定版token,只有不等于空字符串的情况下才会返回access_token信息,未空的情况,继续调去微信服务

* 微信稳定性获取 access_token 接口,添加防止并发性获取 access_token 和多次微信服务获取代码

---------

Co-authored-by: w_yangyili <w_yangyili@xiwang.com>
2024-11-26 12:13:49 +08:00
Jiaxi_Wu
5b29289dbb fix: 修复缓存失效时,可能会重复获取accessToken的问题 (#762)
* fix: 修复缓存失效时,可能会重复获取accessToken的问题

* feat: 添加获取AK失败时的错误信息返回

---------

Co-authored-by: wujiaxi <wujiaxi@expandera.cn>
2024-01-12 19:23:09 +08:00
leonard627
0ffe34187a fix:compatibility cache expiration returns empty string issue (#742) 2023-11-02 09:42:17 +08:00
markwang
49c4cfaf54 fix:GetAccessTokenContext从cache中获取字符窜为空时,从微信服务器获取 (#721)
Co-authored-by: markwang <www.wang61@qq.com>
2023-09-24 10:47:43 +08:00
welllog
8821a3856d feat: 获取稳定版接口调用凭据 (#669)
* feat: 获取稳定版接口调用凭据

* Update default_access_token.go

* fix: format code

---------

Co-authored-by: ctr <orinfy@foxmail.com>
Co-authored-by: houseme <housemecn@gmail.com>
2023-04-18 11:54:34 +08:00
okhowang
5380d5bee7 GetAccessToken支持Context (#618) 2022-09-29 14:33:53 +08:00
houseme
96c1f98944 [feature] Format the code and improve Mini Program authorization to o… (#473)
* [feature] Format the code and improve Mini Program authorization to obtain openid(miniprogram/auth/auth.go Code2Session)

* [feature] CheckEncryptedData (https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/user-info/auth.checkEncryptedData.html)

* upgrade json error

* upgrade json error

Co-authored-by: houseme <houseme@outlook.com>
2021-09-08 11:03:23 +08:00
80d91d8316 使用双检锁优化 Token 获取 (#444) 2021-08-26 10:34:24 +08:00
从小就很酷
c1e4e2c9d0 增加企业微信 企业内部开发模块 (#418)
* 增加小程序内容安全接口

* 内容安全接口 按照golint规范进行优化

* 内容安全接口 按照golint规范进行优化

* 删除CheckImage中的输出代码

* 小程序内容安全接口

* 小程序内容安全接口

* 小程序内容安全接口
1:修改返回值 改为error异常统一返回

* 增加企业微信 企业内部开发模块
1:授权登录

* 增加企业微信 企业内部开发模块

* 修改参数为小写

* 优化参数格式

Co-authored-by: root <admin@example.com>
2021-07-16 10:28:54 +08:00
silenceper
972dec0406 将小程序获取ak的方式也抽象出来 2020-05-25 22:00:51 +08:00
silenceper
b599e93c5b 将获取AccessToken和jsTicket单独抽象为interface 2020-05-25 21:55:42 +08:00