视频进行工号验证

This commit is contained in:
zhaolongfei
2024-11-08 17:32:55 +08:00
parent 16df953a86
commit cb9e94ce5e

View File

@@ -124,14 +124,21 @@ public class CourseWareApi extends ApiBaseController {
token = request.getHeader("token");
}
// 读取cookies中的时间
String cookieTime = getSignTimeCookie(request);
if (StringUtils.isBlank(cookieTime)) {
return badRequest("不支持的请求");
}
// String cookieTime = getSignTimeCookie(request);
// if (StringUtils.isBlank(cookieTime)) {
// return badRequest("不支持的请求");
// }
String userInfo = CacheName.NAME_INFO + ":"+ token;
Object o = redisTemplate.opsForValue().get(userInfo);
if (o == null) {
log.error("从 Redis 获取的值为 null ,", userInfo);
return badRequest("token验证错误");
}
// 将对象转换为字符串
String userNoStr = o.toString();
// 检查字符串是否为空或空白
if (StringUtils.isBlank(userNoStr)) {
log.error("从 Redis 获取的值为空或空白,", userInfo);
return badRequest("token验证错误");
}
HashMap bean = JSONUtil.toBean(userNoStr, HashMap.class);