Przeglądaj źródła

fix bug

release_toaliyun_real
lin 3 lat temu
rodzic
commit
569e489021
2 zmienionych plików z 27 dodań i 7 usunięć
  1. +3
    -1
      mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java
  2. +24
    -6
      mallinkCApi/src/main/java/com/iformall/interceptor/AuthorizationInterceptor.java

+ 3
- 1
mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java Wyświetl plik

@@ -72,12 +72,14 @@ public class WxCouponController extends BaseController {
@ApiOperation("根据id(couponChannel)查询详情接口")
@GetMapping("/couponDetail")
@ApiImplicitParams({
@ApiImplicitParam(name = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true)})
@ApiImplicitParam(name = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true),
@ApiImplicitParam(name = "mallTenantId", value = "mallTenantId", dataType = "String", paramType = "query", required = false)})
public ResultData couponDetail(String couponChannelId) {
if ((StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED))
) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId为空");
}
Long couponChannelIdL = 0L;

try {


+ 24
- 6
mallinkCApi/src/main/java/com/iformall/interceptor/AuthorizationInterceptor.java Wyświetl plik

@@ -63,15 +63,29 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
if(cUser == null || cUser.getExpireTime().getTime() < System.currentTimeMillis()){
throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录");
}

//集团版中针对某一商场的业务需要传递mallTenantId
String mallTenantId = request.getHeader("mallTenantId");
if(StringUtils.isBlank(mallTenantId)){
mallTenantId = request.getParameter("mallTenantId");
}
//设置userId到request里,后续根据userId,获取用户信息
request.setAttribute(Constant.LOGIN_USER_KEY, cUser.getId());
request.setAttribute(Constant.TENANT_ID, cUser.getTenantId());
if (!StringUtils.isBlank(mallTenantId)) {
request.setAttribute(Constant.TENANT_ID, mallTenantId);
request.setAttribute(Constant.PARENT_TENANT_ID, cUser.getTenantId());
}else {
request.setAttribute(Constant.TENANT_ID, cUser.getTenantId());
if (StringUtils.isNotBlank(cUser.getParentTenantId())) {
request.setAttribute(Constant.PARENT_TENANT_ID, cUser.getParentTenantId());
}
}
request.setAttribute(Constant.REQUEST_C_USER_KEY, cUser);
request.setAttribute(Constant.APP_INFO,cUser.getAppinfo());
if (StringUtils.isNotBlank(cUser.getParentTenantId())) {
request.setAttribute(Constant.PARENT_TENANT_ID, cUser.getParentTenantId());
}
if(cUser.basicInfoIs()){
request.setAttribute(Constant.LOGIN_MEMBER_KEY, cUser.getUserId());
}
@@ -86,7 +100,11 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
if(tenantIgnoreAnnotation != null){
TenantThreadLocal.remove();
}else {
TenantThreadLocal.setCurrentThreadTenant(cUser.getTenantId(), cUser.getParentTenantId());
if (!StringUtils.isBlank(mallTenantId)) {
TenantThreadLocal.setCurrentThreadTenant(cUser.getTenantId(), cUser.getParentTenantId());
}else {
TenantThreadLocal.setCurrentThreadTenant(mallTenantId, cUser.getTenantId());
}
}

return true;


Ładowanie…
Anuluj
Zapisz