|
@@ -20,6 +20,7 @@
|
|
|
package edp.davinci.core.inteceptor;
|
|
|
|
|
|
import com.alibaba.druid.util.StringUtils;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import edp.core.annotation.AuthIgnore;
|
|
|
import edp.core.annotation.AuthShare;
|
|
@@ -95,11 +96,18 @@ public class AuthenticationInterceptor implements HandlerInterceptor
|
|
|
response.getWriter().print(ErrorMsg.ERR_MSG_AUTHENTICATION);
|
|
|
return false;
|
|
|
}
|
|
|
+ log.debug("{} : ticket is found in url ", request.getServletPath());
|
|
|
System.out.println(">>>>>" + ticket);
|
|
|
- Map<String,Object> redisMap = (Map<String, Object>) redisUtils.get(ticket);
|
|
|
- Map<String,Object> userMap = (Map<String, Object>) redisMap.get("user");
|
|
|
- System.out.println(userMap.get("username"));
|
|
|
- String username = (String) userMap.get("username");
|
|
|
+ Object redisMap = (Map<String, Object>) redisUtils.get(ticket);
|
|
|
+ if (null == redisMap)
|
|
|
+ {
|
|
|
+ log.debug("{} : ticket is not found in redis", ticket);
|
|
|
+ response.setStatus(HttpCodeEnum.FORBIDDEN.getCode());
|
|
|
+ response.getWriter().print(ErrorMsg.ERR_MSG_PERMISSION);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ JSONObject userinfo = (JSONObject) JSONObject.toJSON(redisMap);
|
|
|
+ String username = userinfo.getString("username");
|
|
|
User user = userService.getByUsername(username);
|
|
|
if (null == user)
|
|
|
{
|