|
@@ -30,7 +30,6 @@ import com.zskk.shop.controller.bean.UserInfoBean;
|
|
import com.zskk.shop.exception.ErrorConstant;
|
|
import com.zskk.shop.exception.ErrorConstant;
|
|
import com.zskk.shop.exception.ZSKKError;
|
|
import com.zskk.shop.exception.ZSKKError;
|
|
import com.zskk.shop.exception.ZSKKException;
|
|
import com.zskk.shop.exception.ZSKKException;
|
|
-import com.zskk.shop.utils.LogUtil;
|
|
|
|
import com.zskk.shop.utils.SecretUtil;
|
|
import com.zskk.shop.utils.SecretUtil;
|
|
|
|
|
|
public class AbstractController {
|
|
public class AbstractController {
|
|
@@ -147,6 +146,19 @@ public class AbstractController {
|
|
model.addAttribute("loginurl", uccenter + "login/authorize?needtoken=false&redirect=" + urlEncoding(myhost));
|
|
model.addAttribute("loginurl", uccenter + "login/authorize?needtoken=false&redirect=" + urlEncoding(myhost));
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ protected HttpServletRequest getRequest() {
|
|
|
|
+ return ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
|
+ protected <T> T getSession(String key) {
|
|
|
|
+ return (T)this.getRequest().getSession().getAttribute(key);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setSession(String key, Object obj){
|
|
|
|
+ this.getRequest().getSession().setAttribute(key, obj);
|
|
|
|
+ }
|
|
|
|
|
|
private String getCookieValue(String name) throws InvalidKeyException, NoSuchAlgorithmException,
|
|
private String getCookieValue(String name) throws InvalidKeyException, NoSuchAlgorithmException,
|
|
NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException {
|
|
NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException {
|