mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-07 01:46:47 +08:00
视频进行工号验证
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user