|
|
|
@@ -7,6 +7,7 @@ import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.domain.po.WxCUser; |
|
|
|
import com.iformall.domain.po.base.BaseCUserEntity; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.interceptor.BodyReaderHttpServletRequestWrapper; |
|
|
|
import com.iformall.service.CUserTokenService; |
|
|
|
import com.iformall.utils.HashUtil; |
|
|
|
import com.iformall.utils.RedisLock; |
|
|
|
@@ -72,15 +73,33 @@ public class RedisCacheAspect { |
|
|
|
//throw new MallinkException(ErrorCode.NET_TOKEN_EMPTY.getCode(),"token为空["+token+"]"); |
|
|
|
} |
|
|
|
log.info("token>>>>>>>>>>>>>>>"+token); |
|
|
|
String tenantId; |
|
|
|
BaseCUserEntity cUser = null ; |
|
|
|
if(StringUtils.isNotBlank(token)) { |
|
|
|
cUser = cUserTokenService.getByToken(token); |
|
|
|
|
|
|
|
//集团版中针对某一商场的业务需要传递mallTenantId |
|
|
|
String mallTenantId = request.getHeader("mallTenantId"); |
|
|
|
if(StringUtils.isBlank(mallTenantId)){ |
|
|
|
mallTenantId = request.getParameter("mallTenantId"); |
|
|
|
} |
|
|
|
if (Objects.isNull(cUser) || cUser.getExpireTime().getTime() < System.currentTimeMillis()) { |
|
|
|
tenantId = "0"; |
|
|
|
} else { |
|
|
|
tenantId = cUser.getTenantId(); |
|
|
|
if(StringUtils.isBlank(mallTenantId)){ |
|
|
|
try{ |
|
|
|
String body = ((BodyReaderHttpServletRequestWrapper) request).getBody(); |
|
|
|
mallTenantId = JSONObject.parseObject(body).getString("mallTenantId"); |
|
|
|
}catch(Exception e){} |
|
|
|
} |
|
|
|
|
|
|
|
String tenantId = null; |
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(mallTenantId)){ |
|
|
|
tenantId = mallTenantId; |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(tenantId)){ |
|
|
|
if(StringUtils.isNotBlank(token)) { |
|
|
|
BaseCUserEntity cUser = cUserTokenService.getByToken(token); |
|
|
|
if (Objects.isNull(cUser) || cUser.getExpireTime().getTime() < System.currentTimeMillis()) { |
|
|
|
tenantId = "0"; |
|
|
|
} else { |
|
|
|
tenantId = cUser.getTenantId(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 请求参数 |
|
|
|
|