forked from qiurunze123/miaosha
-
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
qiurunze
committed
Feb 15, 2019
1 parent
cc2860a
commit 8e9f742
Showing
527 changed files
with
201,852 additions
and
310 deletions.
There are no files selected for viewing
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
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
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
32 changes: 32 additions & 0 deletions
32
miaosha-2version/miaosha-common/src/main/java/com/geekq/miasha/utils/UserContext2.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,32 @@ | ||
package com.geekq.miasha.utils; | ||
|
||
import com.geekq.miasha.entity.Logininfo; | ||
import org.springframework.web.context.request.RequestContextHolder; | ||
import org.springframework.web.context.request.ServletRequestAttributes; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
|
||
/** | ||
* @author 邱润泽 | ||
* | ||
* thread local 底层实现方法 和 UserContext 类似 本质上都是 每个线程工作都在自己的实例线程上拷贝 | ||
*/ | ||
public class UserContext2 { | ||
|
||
public static final String LOGIN_IN_SESSION = "logininfo"; | ||
|
||
private static HttpServletRequest getRequest() { | ||
return ((ServletRequestAttributes) RequestContextHolder | ||
.getRequestAttributes()).getRequest(); | ||
} | ||
|
||
public static void putLogininfo(Logininfo logininfo) { | ||
getRequest().getSession().setAttribute(LOGIN_IN_SESSION, logininfo); | ||
} | ||
|
||
public static Logininfo getCurrent() { | ||
return (Logininfo) getRequest().getSession().getAttribute( | ||
LOGIN_IN_SESSION); | ||
} | ||
|
||
} |
28 changes: 18 additions & 10 deletions
28
miaosha-2version/miaosha-common/src/main/java/com/geekq/miasha/vo/LoginVo.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
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
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
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
2 changes: 2 additions & 0 deletions
2
miaosha-2version/miaosha-web/src/main/java/com/geekq/miaosha/GeekQMainApplication.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
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
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
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
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
22 changes: 0 additions & 22 deletions
22
...-2version/miaosha-web/src/main/java/com/geekq/miaosha/controller/LoginInfoController.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.