Commit 4af94a9a by fanjiaxin

绑定分佣比例加入日志

parent 5b0cf5bc
Pipeline #71941 passed with stages
in 1 minute 1 second
...@@ -54,4 +54,11 @@ public class LoginUserHelper { ...@@ -54,4 +54,11 @@ public class LoginUserHelper {
redisClient.setStr(CoreConstant.REDIS_TOKEN_USER_KEY + token, redisClient.setStr(CoreConstant.REDIS_TOKEN_USER_KEY + token,
JSON.toJSONString(loginUserInfo), CoreConstant.REDIS_TOKEN_EXPIRE_SECONDS); JSON.toJSONString(loginUserInfo), CoreConstant.REDIS_TOKEN_EXPIRE_SECONDS);
} }
/**
* 删除用户认证信息
*/
public void removeLoginUserInfo(String token) {
redisClient.delete(CoreConstant.REDIS_TOKEN_USER_KEY + token);
}
} }
...@@ -6,6 +6,7 @@ import com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserInfo; ...@@ -6,6 +6,7 @@ import com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserInfo;
import com.netease.yanxuan.wx.store.sharer.common.constant.CoreConstant; import com.netease.yanxuan.wx.store.sharer.common.constant.CoreConstant;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerInterceptor;
...@@ -29,6 +30,10 @@ public class UserInterceptor implements HandlerInterceptor { ...@@ -29,6 +30,10 @@ public class UserInterceptor implements HandlerInterceptor {
String token = request.getHeader(CoreConstant.AUTH_HEADER_TOKEN_KEY); String token = request.getHeader(CoreConstant.AUTH_HEADER_TOKEN_KEY);
LoginUserInfo loginUserInfo = loginUserHelper.getLoginUserInfo(token); LoginUserInfo loginUserInfo = loginUserHelper.getLoginUserInfo(token);
if (null != loginUserInfo) { if (null != loginUserInfo) {
if(StringUtils.isBlank(loginUserInfo.getUnionId())){
loginUserHelper.removeLoginUserInfo(token);
return true;
}
// 刷新缓存 // 刷新缓存
loginUserHelper.setLoginUserInfo(token, loginUserInfo); loginUserHelper.setLoginUserInfo(token, loginUserInfo);
LoginUserContextHolder.set(loginUserInfo); LoginUserContextHolder.set(loginUserInfo);
......
package com.netease.yanxuan.wx.store.sharer.biz.service.impl; package com.netease.yanxuan.wx.store.sharer.biz.service.impl;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.netease.yanxuan.wx.store.sharer.biz.config.DrmSharerConfig; import com.netease.yanxuan.wx.store.sharer.biz.config.DrmSharerConfig;
...@@ -33,9 +25,15 @@ import com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatShare ...@@ -33,9 +25,15 @@ import com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatShare
import com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatSharerListVO; import com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatSharerListVO;
import com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatSharerRegisterBindVO; import com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatSharerRegisterBindVO;
import com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatUserInfoVO; import com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatUserInfoVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
/** /**
......
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
*/ */
package com.netease.yanxuan.wx.store.sharer.web.controller; package com.netease.yanxuan.wx.store.sharer.web.controller;
import com.netease.yanxuan.wx.store.sharer.common.core.Result; import com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserHelper;
import com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatUserInfoVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -19,10 +18,6 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -19,10 +18,6 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/sharer/test") @RequestMapping("/sharer/test")
@RequiredArgsConstructor @RequiredArgsConstructor
public class TestController { public class TestController {
private final LoginUserHelper loginUserHelper;
@RequestMapping("/token")
public Result<WeChatUserInfoVO> token() {
return Result.ok();
}
} }
\ No newline at end of file
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