|
@@ -79,7 +79,6 @@ public class CommonLogic {
|
|
|
|
|
|
String appid = CommonUtils.getAPPID(request);
|
|
|
String userId = CommonUtils.getUserId(request);
|
|
|
- String device = request.getHeader("device");
|
|
|
String token = CommonUtils.getToken(request);
|
|
|
if (StringUtils.isBlank(token)) {
|
|
|
token = request.getParameter("token");
|
|
@@ -89,36 +88,21 @@ public class CommonLogic {
|
|
|
token = request.getParameter("x-token");
|
|
|
}
|
|
|
|
|
|
- if (StringUtils.isBlank(device) && StringUtils.isBlank(appid)) {
|
|
|
- throw new RemoteServiceException("非法请求,缺少必须的参数");
|
|
|
- }
|
|
|
log.info("打印token:"+token);
|
|
|
AdminCompanyWechat adminCompanyWechat;
|
|
|
User user = null;
|
|
|
- if (StringUtils.isBlank(device)) {
|
|
|
- adminCompanyWechat = adminCompanyWechatService.lambdaQuery()
|
|
|
- .eq(AdminCompanyWechat::getSubAppId, appid)
|
|
|
+
|
|
|
+ adminCompanyWechat = adminCompanyWechatService.lambdaQuery()
|
|
|
+ .eq(AdminCompanyWechat::getSubAppId, appid)
|
|
|
// .or()
|
|
|
// .eq(AdminCompanyWechat::getPubAppId,appid)
|
|
|
- .one();
|
|
|
- if (adminCompanyWechat == null) {
|
|
|
- throw new RemoteServiceException("非法请求,请联系管理员配置必要的参数:" + appid);
|
|
|
- }
|
|
|
-
|
|
|
- user = userService.getById(userId);
|
|
|
- } else {
|
|
|
- adminCompanyWechat = adminCompanyWechatService.lambdaQuery()
|
|
|
- .last("limit 1")
|
|
|
- .one();
|
|
|
- if (StringUtils.isNotBlank(token)) {
|
|
|
- Object result = redisUtil.get(Constant.RedisPrefix.TOKEN_APP_USER + token);
|
|
|
- if (Objects.isNull(result)) {
|
|
|
- throw new RemoteServiceException("非法请求,登录信息不存在");
|
|
|
- }
|
|
|
- user = (User) result;
|
|
|
- }
|
|
|
+ .one();
|
|
|
+ if (adminCompanyWechat == null) {
|
|
|
+ throw new RemoteServiceException("非法请求,请联系管理员配置必要的参数:" + appid);
|
|
|
}
|
|
|
|
|
|
+ user = userService.getById(userId);
|
|
|
+
|
|
|
CurrentCompanyWechat currentCompanyWechat = new CurrentCompanyWechat();
|
|
|
BeanUtils.copyProperties(adminCompanyWechat, currentCompanyWechat);
|
|
|
if (Objects.nonNull(user)) {
|