|
背景:因为现有接口企业微信的考勤数据只有管理员账户可以调用,只好自己弄一个,获取当前用户的企业微信考勤。
参考:https://www.yuque.com/o2oa/course/tuef8c
版本:6.4.4
问题:当前用户信息一直是Anonymous
相关代码:
JaxrsServicePathFilter.java 中设置了需要登陆才能访问
@WebFilter(urlPatterns = { "/servlet/*", "/jaxrs/qywxAttendance/*", }, asyncSupported = true)
public class JaxrsServicePathFilter extends CipherManagerUserJaxrsFilter {
}
Action 类中 定义了 EffectivePerson effectivePerson = this.effectivePerson(request);
@Path("expand/qywxAttendance")
@JaxrsDescribe("企业微信考勤")
public class QywxAttendanceDetailAction extends StandardJaxrsAction {
private static Logger logger = LoggerFactory.getLogger(QywxAttendanceDetailAction.class);
@JaxrsMethodDescribe(value = "列示当前用户/指定用户的企业微信打卡记录,分页..", action = ActionListPaging.class)
@POST
@Path("list/paging/{page}/size/{size}")
@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
@Consumes(MediaType.APPLICATION_JSON)
public void listPaging(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
@JaxrsParameterDescribe("分页") @PathParam("page") Integer page,
@JaxrsParameterDescribe("每页数量") @PathParam("size") Integer size, JsonElement jsonElement) {
ActionResult<List<ActionListPaging.Wo>> result = new ActionResult<>();
EffectivePerson effectivePerson = this.effectivePerson(request);
System.out.println(this.effectivePerson(request).toString());
try {
result = new ActionListPaging().execute(effectivePerson, page, size, jsonElement);
} catch (Exception e) {
logger.error(e, effectivePerson, request, jsonElement);
result.error(e);
}
asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result, jsonElement));
}
}
通过System.out.println(this.effectivePerson(request).toString()); 输出后,结果如下
理论上来说,必须要登陆才能访问,用户信息肯定是有的,就是不知道没获取到
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|