/java-skills:sa-token-integrationfrom java-skills
Extends Sa-Token with JWT integration (Simple/Mixin/Stateless), Redis persistence, Alone-Redis cache isolation, AOP annotation auth, SpEL expressions, Quick-Login, JSON serializers, template engines, and RPC context propagation.
Ships in java-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
基于 sa-token-doc/plugin/ 集成类文档。
当用户需要以下场景时,激活此技能:
Step 1. 确定集成需求 — 选择JWT/Redis/AOP/模板等模块 Step 2. 引入依赖 — 添加对应Maven/Gradle依赖 Step 3. 配置参数 — 配置jwt-secret-key/Redis连接/Alone-Redis等 Step 4. 注入实现 — 注入StpLogic、注册过滤器、配置模板引擎 Step 5. 验证测试 — 确认集成生效,测试核心功能是否正常
jwt-secret-keyspring.redis 连接信息| 主题 | 文件 | 来源 |
|---|---|---|
| JWT三模式(Simple/Mixin/Stateless) | references/jwt-extend.md | GitHub |
| Redis持久化+Alone-Redis | references/dao-extend.md | dao-extend、integ-redis |
Q: JWT三种模式怎么选? A: Simple模式推荐(功能完整:踢人、封禁、会话管理都支持)。需要无状态选Stateless(但踢人/封禁不可用)。Mixin介于两者之间。
Q: Redis两种序列化方式选哪个? A: 推荐RedisTemplate JSON序列化(数据可读,方便排查)。JDK序列化兼容性更好但数据是乱码。
Q: Alone-Redis和普通Redis有什么区别? A: Alone-Redis使用独立的Redis连接和数据库,与业务Redis完全隔离,保证认证缓存不受业务影响。
Q: AOP注解鉴权和拦截器鉴权能同时用吗? A: 不能同时使用。AOP用于Service层,拦截器用于Controller层,选择一种即可。
Q: Quick-Login适合生产环境吗? A: 适合小系统或内部管理系统。生产环境建议自定义登录页面。
Q: 模板引擎标签支持哪些功能?
A: 支持 sa:login(登录校验)、sa:hasRole(角色判断)、sa:hasPermission(权限判断)等标签。
is-share 恒等于false — 与Extra数据不兼容,无法共用tokenis-concurrent 必须为true — 否则踢人下线API不可用sa-token-alone-redis — 不是 spring.redis本技能不收集、存储或传输任何用户数据。所有代码示例仅供本地开发参考。
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (full-stack-skills/java-skills) — no native marketplace selected
npx claudepluginhub p/full-statck-skills-java-skills39 skills in this plugin
/caffeine-patternsCaffeine JVM 本地缓存技能。覆盖本地缓存 vs 远程缓存(Redis)选择决策树、expireAfterWrite vs expireAfterAccess vs refreshAfterWrite 三种过期策略对比与组合规则(refresh < expire)、CacheLoader加载与reload异步刷新模式、Spring Cache @Cacheable集成、maximumSize驱逐策略、recordStats缓存统计。 纠正 LLM:用 ConcurrentHashMap+手动过期、所有缓存走Redis、refreshAfterWrite > expireAfterWrite导致永远不刷新、CacheLoader返回null导致缓存穿透。/commons-patternsApache Commons 最佳实践模式。从官方文档提炼,覆盖 Commons Lang3(StringUtils千面判空/isEmpty vs isBlank/Validate抛NullPointerException迁移)、Commons IO(IOUtils.toString大文件陷阱/FileUtils.lineIterator逐行读模式/FilenameUtils.normalize路径规范化)、Commons Collections4(CollectionUtils.union/intersection/subtract集合运算)。 纠正 LLM 误用:混淆 StringUtils.isBlank vs isEmpty、IOUtils.toString 读大文件OOM、不知道 LineIterator 逐行读模式、用 lang 而非 lang3 包名。/