Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

关于DynamicTokenProvider用法 #240

vicenteyu started this conversation in Ideas
Discussion options

#239

关于此功能用法:

/// <summary>
/// 多应用接口:可同时使用的发送消息接口
/// </summary>
[DynamicToken("{app_id}"), HttpPost("post/messages")]
Task<PostMessageResponseDto> PostMessageAsync([Ignore] string app_id, [JsonContent] PostMessageDto dto);

通过传递app_id的方式实现多个应用(多个app_id和key)同时调用一套接口。
为避免 app_id 泄露,增加Ignore 属性,可以忽略此参数在请求内容中出现。
DynamicToken 接收到app_id参数后先从缓存中查找token,如果token过期,则重新获取。获取成功后继续请求接口。

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
1 participant

AltStyle によって変換されたページ (->オリジナル) /