From 7ad13a1c9ddfb23786578fef452d56cd6d63d6b8 Mon Sep 17 00:00:00 2001 From: click33 <2393584716@qq.com> Date: Fri, 12 Apr 2024 12:46:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=20Autowired=20=E6=9B=B4=E6=8D=A2?= =?UTF-8?q?=E4=B8=BA=E6=9B=B4=E5=90=88=E9=80=82=E7=9A=84=20PostConstruct?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sa-token-doc/plugin/jwt-extend.md | 4 ++-- sa-token-doc/up/many-account.md | 4 ++-- sa-token-doc/up/token-style.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sa-token-doc/plugin/jwt-extend.md b/sa-token-doc/plugin/jwt-extend.md index 84f534b8..988dcd48 100644 --- a/sa-token-doc/plugin/jwt-extend.md +++ b/sa-token-doc/plugin/jwt-extend.md @@ -191,7 +191,7 @@ sa-token-jwt 插件默认只为 `StpUtil` 注入 `StpLogicJwtFoxXxx` 实现, /** * 为 StpUserUtil 注入 StpLogicJwt 实现 */ -@Autowired +@PostConstruct public void setUserStpLogic() { StpUserUtil.setStpLogic(new StpLogicJwtForSimple(StpUserUtil.TYPE)); } @@ -207,7 +207,7 @@ public void setUserStpLogic() { /** * 自定义 SaJwtUtil 生成 token 的算法 */ -@Autowired +@PostConstruct public void setSaJwtTemplate() { SaJwtUtil.setSaJwtTemplate(new SaJwtTemplate() { @Override diff --git a/sa-token-doc/up/many-account.md b/sa-token-doc/up/many-account.md index 406c4ad7..5808affb 100644 --- a/sa-token-doc/up/many-account.md +++ b/sa-token-doc/up/many-account.md @@ -89,7 +89,7 @@ public String info() { ``` java @Configuration public class SaTokenConfigure { - @Autowired + @PostConstruct public void rewriteSaStrategy() { // 重写Sa-Token的注解处理器,增加注解合并功能 SaStrategy.instance.getAnnotation = (element, annotationClass) -> { @@ -167,7 +167,7 @@ public class StpUserUtil { @Configuration public class SaTokenConfigure { - @Autowired + @PostConstruct public void setSaTokenConfig() { // 设定 StpUtil 使用的 SaTokenConfig 配置参数对象 SaTokenConfig config1 = new SaTokenConfig(); diff --git a/sa-token-doc/up/token-style.md b/sa-token-doc/up/token-style.md index 99e31e69..459ad571 100644 --- a/sa-token-doc/up/token-style.md +++ b/sa-token-doc/up/token-style.md @@ -48,7 +48,7 @@ public class SaTokenConfigure { /** * 重写 Sa-Token 框架内部算法策略 */ - @Autowired + @PostConstruct public void rewriteSaStrategy() { // 重写 Token 生成策略 SaStrategy.instance.createToken = (loginId, loginType) -> {