Commit 030dd5e6 authored by 李健华's avatar 李健华

注解修改

parent 77bd5624
......@@ -16,7 +16,6 @@ import cn.quantgroup.xyqb.risk.uereventcollecting.UserEventCollectingUtil;
import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.util.TenantUtil;
import cn.quantgroup.xyqb.util.encrypt.Md5Util;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
......@@ -25,13 +24,11 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.StreamUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
......@@ -90,14 +87,23 @@ public class LoginInterceptorAspect {
private Object around(ProceedingJoinPoint pjp) throws Throwable {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
byte[] bodyBytes = StreamUtils.copyToByteArray(request.getInputStream());
String body = new String(bodyBytes, request.getCharacterEncoding());
Integer tenantId = null;
if (body != null) {
HashMap hashMap = JSON.parseObject(body, HashMap.class);
tenantId = Integer.parseInt(hashMap.get("tenantId").toString());
}
String tenId = request.getParameter("tenantId");
if (null != tenId) {
tenantId = Integer.parseInt(tenId);
}
// if (null == tenId) {
// byte[] bodyBytes = StreamUtils.copyToByteArray(request.getInputStream());
//
// String body = new String(bodyBytes, request.getCharacterEncoding());
// if (!"".equals(body)) {
// HashMap hashMap = JSON.parseObject(body, HashMap.class);
// tenantId = Integer.parseInt(hashMap.get("tenantId").toString());
// }
// } else {
// tenantId = Integer.parseInt(tenId);
// }
/**
* 拿参数
*/
......
package cn.quantgroup.xyqb.controller.internal.user;
import cn.quantgroup.xyqb.aspect.accessable.IpValidator;
import cn.quantgroup.xyqb.aspect.captcha.LoginInterceptor;
import cn.quantgroup.xyqb.controller.IBaseController;
import cn.quantgroup.xyqb.entity.Merchant;
import cn.quantgroup.xyqb.entity.User;
......@@ -299,7 +300,7 @@ public class AppController implements IBaseController {
* @return Token和phoneNo
* @yapi http://yapi.quantgroups.com/project/17/interface/api/171
*/
// @LoginInterceptor
@LoginInterceptor
@IpValidator
@RequestMapping("/login2")
@ApiOperation(value = "免密登陆, 新手机号不自动注册", notes = "免密登陆, 新手机号不自动注册", httpMethod = "POST")
......
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