forked from jeecgboot/JeecgBoot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7cac163
commit 6bc1fe8
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
jeecg-boot-base-core/src/main/java/org/apache/shiro/SecurityUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.apache.shiro; | ||
|
||
import org.apache.shiro.subject.Subject; | ||
|
||
/** | ||
* 兼容处理Online功能使用处理,请勿修改 | ||
* @author eightmonth@qq.com | ||
* @date 2024/4/29 14:05 | ||
*/ | ||
public class SecurityUtils { | ||
|
||
|
||
public static Subject getSubject() { | ||
return new Subject() { | ||
@Override | ||
public Object getPrincipal() { | ||
return Subject.super.getPrincipal(); | ||
} | ||
}; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
jeecg-boot-base-core/src/main/java/org/apache/shiro/subject/Subject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.apache.shiro.subject; | ||
|
||
import org.jeecg.config.security.utils.SecureUtil; | ||
|
||
/** | ||
* 兼容处理Online功能使用处理,请勿修改 | ||
* @author eightmonth@qq.com | ||
* @date 2024/4/29 14:18 | ||
*/ | ||
public interface Subject { | ||
default Object getPrincipal() { | ||
return SecureUtil.currentUser(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters