Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
1a25ac2b9a
|
|
@ -34,14 +34,14 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
|||
// adminConfig.setTimeout(1000);
|
||||
adminConfig.setTokenStyle("simple-uuid");
|
||||
adminConfig.setIsConcurrent(true);
|
||||
adminConfig.setIsShare(false);
|
||||
adminConfig.setIsShare(true);
|
||||
MyStpLogic.ADMIN_LOGIC.setConfig(adminConfig);
|
||||
|
||||
// 小程序配置
|
||||
SaTokenConfig userConfig = new SaTokenConfig();
|
||||
userConfig.setTokenName("token");
|
||||
userConfig.setIsConcurrent(true);
|
||||
userConfig.setIsShare(false);
|
||||
userConfig.setIsShare(true);
|
||||
// config2.setTimeout(2000);
|
||||
userConfig.setTokenStyle("simple-uuid");
|
||||
MyStpLogic.CLIENT_LOGIC.setConfig(userConfig);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.czg.sa;
|
||||
|
||||
import cn.dev33.satoken.SaManager;
|
||||
import cn.dev33.satoken.config.SaTokenConfig;
|
||||
import cn.dev33.satoken.context.SaHolder;
|
||||
import cn.dev33.satoken.context.model.SaRequest;
|
||||
|
|
@ -69,6 +70,13 @@ public class MyStpLogic {
|
|||
}
|
||||
}
|
||||
|
||||
public void reLogin(long id) {
|
||||
StpLogic logic = getLogic();
|
||||
String token = logic.getTokenValue();
|
||||
// 重新绑定新的 userId 到这个 Token
|
||||
SaManager.getSaTokenDao().set(SaManager.getConfig().getTokenName() + ":" + token, String.valueOf(id), SaManager.getConfig().getTimeout());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录账号名称 管理端为用户账号 客户端为openId
|
||||
*
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ import jakarta.annotation.Resource;
|
|||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -60,7 +61,7 @@ import java.util.*;
|
|||
* @since 2025-02-13
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@DubboService
|
||||
public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo> implements OrderInfoService {
|
||||
|
||||
@Lazy
|
||||
|
|
|
|||
Loading…
Reference in New Issue