admin/sql/migrate_t_system_other_config_wechat_token.sql
zzh 8ef9a43f76 feat(wechat): 将 access_token 持久化到 t_system_other_config
改用数据库存储 token 并支持 AppId/Secret 变更时自动清空,替代内存缓存并增加无效 token 重试。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 11:03:36 +08:00

6 lines
503 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 微信公众号 access_token 持久化(仅 wechat_mp 使用,不对前端展示)
ALTER TABLE `t_system_other_config`
ADD COLUMN `AccessToken` VARCHAR(512) NULL COMMENT '微信 access_token(运行时缓存)' AFTER `Remark`,
ADD COLUMN `AccessTokenExpiresIn` INT NOT NULL DEFAULT 0 COMMENT '微信 access_token 有效期秒数 expires_in' AFTER `AccessToken`,
ADD COLUMN `AccessTokenUpdatedAt` DATETIME NULL COMMENT '微信 access_token 最近刷新时间' AFTER `AccessTokenExpiresIn`;