暂时去掉客户端接口权限

cert
anthonywj 2 years ago
parent 4c5c789bb9
commit 255354547a

@ -51,17 +51,11 @@ public class AuthorizeAspect {
}
HttpServletRequest request = attributes.getRequest();
String id = request.getHeader("ADMIN_ID");
if (StrUtil.isBlank(id)) {
String apiKey = request.getHeader("api_key");
String secretKey = request.getHeader("secret_key");
AuthLicense authLicense = authLicenseDao.get(apiKey);
if (authLicense != null && authLicense.getSecretKey().equals(secretKey)) {
} else {
throw new JsonException(ResultEnum.LOGIN_VERIFY_FALL);
}
} else {
String clientType = request.getHeader("CLIENT_TYPE");
if (clientType == null || clientType.equals("locWeb")) {
//系统用户登录权限验证
String id = request.getHeader("ADMIN_ID");
String query = request.getQueryString();
Long adminId = null;
try {
@ -69,7 +63,6 @@ public class AuthorizeAspect {
} catch (Exception e) {
throw new JsonException(ResultEnum.LOGIN_VERIFY_FALL);
}
String token = request.getHeader("ADMIN_TOKEN");
if (token == null) {
throw new JsonException(ResultEnum.LOGIN_VERIFY_FALL);
@ -84,17 +77,33 @@ public class AuthorizeAspect {
if (adminId.compareTo(jwtAdminId) != 0) {
throw new JsonException(ResultEnum.LOGIN_VERIFY_FALL);
}
} else if (clientType.equals("third")) {
//其他第三方接口权限验证
String apiKey = request.getHeader("api_key");
String secretKey = request.getHeader("secret_key");
AuthLicense authLicense = authLicenseDao.get(apiKey);
if (authLicense != null && authLicense.getSecretKey().equals(secretKey)) {
} else {
throw new JsonException(ResultEnum.LOGIN_VERIFY_FALL);
}
} else if (clientType.equals("pcClient")) {
//客户端权限验证 todo
//
// MethodSignature signature = (MethodSignature) joinPoint.getSignature();
// Method method = signature.getMethod();
// AuthRuleAnnotation action = method.getAnnotation(AuthRuleAnnotation.class);
// comnpanyRuleVerify(action.value(), adminId);
} else {
throw new JsonException(ResultEnum.UN_SOURCE_CLIENT);
}
// 判断是否进行权限验证
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
//从切面中获取当前方法
Method method = signature.getMethod();
//得到了方,提取出他的注解
AuthRuleAnnotation action = method.getAnnotation(AuthRuleAnnotation.class);
// 进行权限验证
// authRuleVerify(action.value(), adminId);
}
// 企业接口授权验证
public void comnpanyRuleVerify(String valuem, Long companyId) {
}
}

@ -11,6 +11,7 @@ public enum ResultEnum {
SUCCESS(0, "success"),
NOT_NETWORK(1, "系统繁忙,请稍后再试。"),
LOGIN_VERIFY_FALL(2, "登录失效"),
UN_SOURCE_CLIENT(2, "不明请求来源"),
PARAM_VERIFY_FALL(3, "参数验证错误"),
AUTH_FAILED(4, "权限验证失败"),
DATA_NOT(5, "没有相关数据"),

@ -4,11 +4,14 @@ import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.trace.TraceTaskNoticeEntity;
import com.glxp.api.req.trace.TraceDlTaskRequest;
import com.glxp.api.req.trace.TraceTaskDetailRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.trace.TraceTaskDlResponse;
import com.glxp.api.service.trace.TraceTaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
@ -30,7 +33,7 @@ public class TraceTaskController {
TraceTaskService traceTaskService;
//任务列表
//任务列表
@AuthRuleAnnotation("udi/trace/task/filter")
@GetMapping("udi/trace/task/filter")
public BaseResponse filterTask(TraceTaskDetailRequest traceTaskDetailRequest) {
@ -44,12 +47,19 @@ public class TraceTaskController {
}
//客户端下载追溯任务列表执行下载任务
@AuthRuleAnnotation("udi/trace/task/search")
@GetMapping("udi/trace/task/search")
public BaseResponse downloadTask(TraceDlTaskRequest taskRequest) {
TraceTaskNoticeEntity taskNoticeEntity = traceTaskService.getById(taskRequest.getTaskId());
if (taskNoticeEntity == null) {
return ResultVOUtils.error(500, "任务已过期或任务不存在!");
}
TraceTaskDlResponse taskDlResponse = new TraceTaskDlResponse();
BeanUtils.copyProperties(taskNoticeEntity, taskDlResponse);
return ResultVOUtils.success(taskDlResponse);
}
}

@ -0,0 +1,9 @@
package com.glxp.api.req.trace;
import lombok.Data;
@Data
public class TraceDlTaskRequest {
private Long taskId;
}

@ -10,7 +10,6 @@ import java.util.List;
*/
@Data
public class TraceTaskDlResponse {
private Long id;
/**
* UDI
*/
@ -19,7 +18,7 @@ public class TraceTaskDlResponse {
/**
* ID
*/
private Long recordCode;
private Long produdctRecordIdFk;
/**
* 123
@ -29,10 +28,10 @@ public class TraceTaskDlResponse {
* //
*
*/
private Integer status;
private Integer status;
/**
* DIDI
* DI
* DI
*/
private List<String> diList;

Loading…
Cancel
Save