浏览代码

删除测试代码

weihy 3 年之前
父节点
当前提交
c615acb20f
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 4 5
      site/src/main/java/com/mooctest/crowd/site/controller/CrowdTaskController.java

+ 4 - 5
site/src/main/java/com/mooctest/crowd/site/controller/CrowdTaskController.java

@@ -146,11 +146,10 @@ public class CrowdTaskController{
     @LoginRequired
     @LoginRequired
     @RequestMapping(value = "/project/{projectCode}/task/{taskCode}/token", method = RequestMethod.GET)
     @RequestMapping(value = "/project/{projectCode}/task/{taskCode}/token", method = RequestMethod.GET)
     public ResponseVO<String> getToken(@PathVariable("projectCode") String projectCode, @PathVariable("taskCode") String taskCode, HttpSession session){
     public ResponseVO<String> getToken(@PathVariable("projectCode") String projectCode, @PathVariable("taskCode") String taskCode, HttpSession session){
-//        Object user = session.getAttribute("userId");
+        Object user = session.getAttribute("userId");
-//        if (user == null)
+        if (user == null)
-//            return new ResponseVO<>(ServerCode.ERROR, "未登录,请先登录");
+            return new ResponseVO<>(ServerCode.ERROR, "未登录,请先登录");
-//        Long userId = Long.parseLong((String)session.getAttribute("userId"));
+        Long userId = Long.parseLong((String)session.getAttribute("userId"));
-        Long userId = 99222L;
         return new ResponseVO<>(ServerCode.SUCCESS, taskService.getToken(projectCode, taskCode, userId));
         return new ResponseVO<>(ServerCode.SUCCESS, taskService.getToken(projectCode, taskCode, userId));
     }
     }
 }
 }