mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-08-25 01:14:23 +08:00
StpUtil.getSessionBySessionId 提供的 SessionId 为空时将直接抛出异常,而不是再返回null
This commit is contained in:
parent
217721cae6
commit
579aee164a
@ -119,6 +119,9 @@ public interface SaErrorCode {
|
|||||||
/** 二级认证校验未通过 */
|
/** 二级认证校验未通过 */
|
||||||
int CODE_11071 = 11071;
|
int CODE_11071 = 11071;
|
||||||
|
|
||||||
|
/** 获取 SaSession 时提供的 SessionId 为空 */
|
||||||
|
int CODE_11072 = 11072;
|
||||||
|
|
||||||
|
|
||||||
// ------------
|
// ------------
|
||||||
|
|
||||||
|
@ -1177,7 +1177,7 @@ public class StpLogic {
|
|||||||
|
|
||||||
// 如果提供的 sessionId 为 null,则直接返回 null
|
// 如果提供的 sessionId 为 null,则直接返回 null
|
||||||
if(SaFoxUtil.isEmpty(sessionId)) {
|
if(SaFoxUtil.isEmpty(sessionId)) {
|
||||||
return null;
|
throw new SaTokenException("SessionId 不能为空").setCode(SaErrorCode.CODE_11072);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 先检查这个 SaSession 是否已经存在,如果不存在且 isCreate=true,则新建并返回
|
// 先检查这个 SaSession 是否已经存在,如果不存在且 isCreate=true,则新建并返回
|
||||||
|
Loading…
Reference in New Issue
Block a user