Commit 32a41456 authored by Administrator's avatar Administrator

解决日志中的uId错误

parent 9c95265f
...@@ -80,7 +80,6 @@ public class SecurityInterceptor extends JService implements HandlerInterceptor ...@@ -80,7 +80,6 @@ public class SecurityInterceptor extends JService implements HandlerInterceptor
String sign = request.getParameter("sign"); String sign = request.getParameter("sign");
String cId = request.getParameter("cId"); String cId = request.getParameter("cId");
String uId = request.getParameter("uId"); String uId = request.getParameter("uId");
String str = "cId=" + cId + "&timestamp=" + timestamp + "&uId=" + uId;
// log.info("请求路径:" + str + ",sign:" + DigestUtils.md5DigestAsHex(str.getBytes()) + ",psign:" + sign); // log.info("请求路径:" + str + ",sign:" + DigestUtils.md5DigestAsHex(str.getBytes()) + ",psign:" + sign);
if (NumberUtils.toInt(uId, -1) == -1 || NumberUtils.toInt(uId, -1) == 0) { if (NumberUtils.toInt(uId, -1) == -1 || NumberUtils.toInt(uId, -1) == 0) {
log.info("无用户信息登录"); log.info("无用户信息登录");
...@@ -91,6 +90,7 @@ public class SecurityInterceptor extends JService implements HandlerInterceptor ...@@ -91,6 +90,7 @@ public class SecurityInterceptor extends JService implements HandlerInterceptor
log.info("无权限!"); log.info("无权限!");
throw new RuntimeException("无权限"); throw new RuntimeException("无权限");
} }
String str = "cId=" + cId + "&timestamp=" + timestamp + "&uId=" + uId;
if (!DigestUtils.md5DigestAsHex(str.getBytes()).equals(sign)) { if (!DigestUtils.md5DigestAsHex(str.getBytes()).equals(sign)) {
log.info("签名不一致!"); log.info("签名不一致!");
throw new RuntimeException("签名不一致!"); throw new RuntimeException("签名不一致!");
......
...@@ -31,7 +31,7 @@ public class PhotoController { ...@@ -31,7 +31,7 @@ public class PhotoController {
@RequestMapping("index/{cmptId}") @RequestMapping("index/{cmptId}")
@PageView @PageView
public ModelAndView index(@PathVariable("cmptId") Integer cmptId, public ModelAndView index(@PathVariable("cmptId") Integer cmptId,
@RequestParam("uId") Integer userId, @RequestParam(value = "uId",required = false, defaultValue = "-1") Integer userId,
ModelAndView mv) { ModelAndView mv) {
Cmpt cmpt = cmptService.queryCmptBycmptId(cmptId); Cmpt cmpt = cmptService.queryCmptBycmptId(cmptId);
int nueuserId = cmptService.getCommonNeuUserId(userId); int nueuserId = cmptService.getCommonNeuUserId(userId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment