Commit 9dddf6d9 authored by hezhen's avatar hezhen

123

parent e52017f1
...@@ -76,6 +76,7 @@ public class WeixinService { ...@@ -76,6 +76,7 @@ public class WeixinService {
try { try {
HttpSession session = request.getSession(); HttpSession session = request.getSession();
String frontSessionValue1 = (String) session.getAttribute(frontSessionKey); String frontSessionValue1 = (String) session.getAttribute(frontSessionKey);
log.info("---session获取===="+frontSessionValue1);
if (StringUtils.isBlank(frontSessionValue1)) { if (StringUtils.isBlank(frontSessionValue1)) {
return null; return null;
} }
......
...@@ -8,6 +8,7 @@ import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken; ...@@ -8,6 +8,7 @@ import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.UserAgentUtil; import com.github.wxiaoqi.security.common.util.UserAgentUtil;
import com.xxfc.platform.universal.biz.WeixinService; import com.xxfc.platform.universal.biz.WeixinService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -20,6 +21,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -20,6 +21,7 @@ import javax.servlet.http.HttpServletRequest;
@RestController @RestController
@RequestMapping("info") @RequestMapping("info")
@IgnoreUserToken @IgnoreUserToken
@Slf4j
public class UserInfoController { public class UserInfoController {
...@@ -31,11 +33,12 @@ public class UserInfoController { ...@@ -31,11 +33,12 @@ public class UserInfoController {
@RequestMapping(value = "getOpenId", method = RequestMethod.GET) //匹配的是href中的download请求 @RequestMapping(value = "getOpenId", method = RequestMethod.GET) //匹配的是href中的download请求
public ObjectRestResponse sendSms(HttpServletRequest request) throws Exception { public ObjectRestResponse getOpenId(HttpServletRequest request) throws Exception {
boolean isWx = UserAgentUtil.isWexinBrowser(request); boolean isWx = UserAgentUtil.isWexinBrowser(request);
if (isWx) { if (isWx) {
//session里面获取用户信息 //session里面获取用户信息
String openId=weixinService.getSession(request); String openId=weixinService.getSession(request);
log.info("---进入方法getOpenId----openId===="+openId);
if (StringUtils.isBlank(openId)){ if (StringUtils.isBlank(openId)){
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("sendUrl",sendUrl); json.put("sendUrl",sendUrl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment