lyq hai 5 meses
pai
achega
fe4a82a7e5

+ 14 - 27
src/main/java/com/sooka/module/web/cms/CertificateAuthController.java

@@ -1,17 +1,14 @@
 package com.sooka.module.web.cms;
 
 import com.github.pagehelper.PageInfo;
-import com.sooka.common.annotation.FormToken;
 import com.sooka.common.utils.ControllerUtil;
 import com.sooka.common.utils.JsonUtil;
 import com.sooka.common.utils.StrUtil;
 import com.sooka.module.web.cms.service.ContentService;
 import com.sooka.mybatis.model.TCmsContent;
 import com.sooka.mybatis.model.TCmsSite;
-import com.sooka.mybatis.model.TCmsUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
@@ -21,8 +18,6 @@ import javax.servlet.http.HttpServletRequest;
 import java.util.HashMap;
 import java.util.Map;
 
-import static com.sooka.common.constant.CmsConst.LOGIN_USER;
-
 @Controller
 @RequestMapping("/cms/certificate")
 public class CertificateAuthController {
@@ -31,40 +26,32 @@ public class CertificateAuthController {
     private ContentService contentService;
 
     @RequestMapping("/query")
-    public ModelAndView certificateAuth(HttpServletRequest request,
-            @RequestParam(value = "username",required = false) String username,
-            @RequestParam(value = "telephone",required = false) String telephone,
-            @RequestParam(value = "certificateType",required = false) String certificateType,
-            @RequestParam(value = "siteId", required=false) String siteId,
-            @RequestParam(value = "number",defaultValue = "1") Integer pageNumber){
-        ModelAndView modelAndView=new ModelAndView("www/tuiyijunren/list-zslb");
-        Map<String,Object>map=new HashMap<>();
-        map.put("title",username);
+    public ModelAndView certificateAuth(
+            @RequestParam(value = "username", required = false) String username,
+            @RequestParam(value = "telephone", required = false) String telephone,
+            @RequestParam(value = "certificateType", required = false) String certificateType,
+            @RequestParam(value = "siteId", required = false) String siteId,
+            @RequestParam(value = "number", defaultValue = "1") Integer pageNumber) {
+        ModelAndView modelAndView = new ModelAndView("www/tuiyijunren/list-zslb");
+        Map<String, Object> map = new HashMap<>();
+        map.put("title", username);
         map.put("telephone", telephone);
         map.put("siteId", siteId);
-        map.put("categoryId",certificateType);
+        map.put("categoryId", certificateType);
         PageInfo<TCmsContent> tCmsContentPageInfo = contentService.certificateQuery(pageNumber, map);
         TCmsSite site = new TCmsSite();
         site.setSiteId(Integer.parseInt(siteId));
 
-        TCmsUser user = (TCmsUser) request.getSession().getAttribute(LOGIN_USER);
-        if (user == null) {
-            modelAndView.addObject("btnId", "login");
-        } else {
-            modelAndView.addObject("btnId", "exit");
-            modelAndView.addObject("nickname", user.getNickname());
-        }
-
-        modelAndView.addObject("model",tCmsContentPageInfo);
-        modelAndView.addObject("siteId",siteId);
-        modelAndView.addObject("site",site);
+        modelAndView.addObject("model", tCmsContentPageInfo);
+        modelAndView.addObject("siteId", siteId);
+        modelAndView.addObject("site", site);
         modelAndView.addObject("categoryId", certificateType);
         return modelAndView;
     }
 
     @RequestMapping("/auth")
     @ResponseBody
-    public Map<String, Object> certificateAuth(HttpServletRequest request, @RequestParam(value = "verifyCode",required = false) String verifyCode) {
+    public Map<String, Object> certificateAuth(HttpServletRequest request, @RequestParam(value = "verifyCode", required = false) String verifyCode) {
         System.out.println("verifyCode = " + verifyCode);
         if (StrUtil.isBlank(verifyCode) || !ControllerUtil.validate(verifyCode, request)) {
             return JsonUtil.toMAP(false, "验证码输入错误");