Commit 258bc91c authored by lee_mingzhu's avatar lee_mingzhu

add log

parent 9cf013d9
......@@ -14,6 +14,8 @@ import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.service.wechat.IWechatService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -34,6 +36,8 @@ import java.util.Arrays;
@RequestMapping("/wechat")
public class WeChatController {
private static final Logger LOGGER = LoggerFactory.getLogger(WeChatController.class);
// todo: 配置文件
private static final String TOKEN = "5YihkluEo5QuWAWpFwzvA";
......@@ -169,6 +173,7 @@ public class WeChatController {
*/
@RequestMapping("/receiveCode/{key}")
public void receiveCode(String code, @PathVariable(value = "key") String systemKey, HttpServletResponse response) {
LOGGER.info("微信登录:" + systemKey);
// 从code获取token
Merchant merchant = merchantService.findMerchantByName(systemKey);
......@@ -210,6 +215,7 @@ public class WeChatController {
}
private String createUserSession(User user, Merchant merchant) {
LOGGER.info("微信登录: createUserSession:{} merchant is null:", merchant == null);
if ("baitiao".equals(merchant.getName())) {
return loginInWechatWithSessionCreated(user, merchant, "cashTarget5", Constants.Channel.BAITIAO);
} else {
......@@ -235,6 +241,7 @@ public class WeChatController {
}
private String assembleNormalRedirectUrl(Merchant merchant) {
LOGGER.info("微信登录: assembleNormalRedirectUrl:{} merchant is null:", merchant == null);
if ("baitiao".equals(merchant.getName())) {
return userUIAddr + "/landing?key=baitiao&target=cashTarget5&registerFrom=198&channelId=222";
} else {
......@@ -243,6 +250,7 @@ public class WeChatController {
}
private String assembleWechatRedirectUrl(Merchant merchant, WechatUserInfo userInfo) {
LOGGER.info("微信登录: assembleWechatRedirectUrl:{} merchant is null:", merchant == null);
if ("baitiao".equals(merchant.getName())) {
return userUIAddr + "/landing?key=baitiao&target=cashTarget5&registerFrom=198&channelId=222&isWechat=true&openId=" + userInfo.getOpenId();
} else {
......
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