Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 24, 2025

问题描述

用户反馈在 4.7.0 版本中,配置 wx.miniapp.use-stable-access-token: true 不生效,代码中获取的 useStableAccessToken 仍然是 false

排查结果

通过全面测试和代码分析,确认该配置在当前版本(4.7.7.B)中工作正常。该问题应该已在 4.7.0 到 4.7.7.B 之间的版本中修复。

验证测试

创建了完整的测试应用程序进行验证:

// 属性绑定正常工作
wx.miniapp.use-stable-access-token=true

// 配置在各层正确传递:
WxMaProperties.isUseStableAccessToken() → true
WxMaConfig.isStableAccessToken() → true  
WxMaService.getWxMaConfig().isStableAccessToken() → true

配置链路工作正常:

  1. Spring Boot 将 kebab-case 属性绑定到 WxMaProperties.useStableAccessToken
  2. AbstractWxMaConfigStorageConfiguration 通过 properties.isUseStableAccessToken() 读取配置
  3. 通过 config.useStableAccessToken(boolean) 设置到配置对象
  4. BaseWxMaServiceImpl.getAccessToken() 正确使用该设置选择对应的接口

结论

当前版本无需代码修改,配置功能正常工作。遇到此问题的用户建议升级到 4.7.7.B 或更新版本。

测试确认了所有存储配置(Memory、Redis、Redisson)下,truefalse 两个值的属性绑定都能正常工作。

Fixes #3696

Fixes #3696


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] useStableAccessToken配置true不生效 Verify and document useStableAccessToken configuration behavior Sep 24, 2025
Copilot finished work on behalf of binarywang September 24, 2025 14:06
Copilot AI requested a review from binarywang September 24, 2025 14:06
@binarywang binarywang added this to the 4.7.9 milestone Sep 24, 2025
@binarywang binarywang modified the milestones: 4.7.9, 4.8.0 Nov 27, 2025
@binarywang
Copy link
Owner

@copilot 请用中文改下描述文字

Copy link
Contributor Author

Copilot AI commented Nov 28, 2025

@copilot 请用中文改下描述文字

已将 PR 描述改为中文。

Copilot AI changed the title Verify and document useStableAccessToken configuration behavior 验证并记录 useStableAccessToken 配置行为 Nov 28, 2025
Copilot finished work on behalf of binarywang November 28, 2025 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

useStableAccessToken配置true不生效

2 participants