|
@@ -8,6 +8,7 @@ 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;
|
|
@@ -20,6 +21,8 @@ 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 {
|
|
@@ -28,23 +31,12 @@ public class CertificateAuthController {
|
|
|
private ContentService contentService;
|
|
|
|
|
|
@RequestMapping("/query")
|
|
|
- public ModelAndView certificateAuth(
|
|
|
- HttpServletRequest request,
|
|
|
- @RequestParam(value = "verifyCode",required = false) String verifyCode,
|
|
|
+ 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){
|
|
|
- System.out.println("verifyCode = " + verifyCode);
|
|
|
- System.out.println("username = " + username);
|
|
|
- System.out.println("telephone = " + telephone);
|
|
|
- System.out.println("certificateType = " + certificateType);
|
|
|
- System.out.println("siteId = " + siteId);
|
|
|
- if(StrUtil.isBlank(verifyCode)|| !ControllerUtil.validate(verifyCode,request)) {
|
|
|
- System.out.println(" 验证码错误!!!!!!! ");
|
|
|
- }
|
|
|
-
|
|
|
ModelAndView modelAndView=new ModelAndView("www/tuiyijunren/list-zslb");
|
|
|
Map<String,Object>map=new HashMap<>();
|
|
|
map.put("title",username);
|
|
@@ -54,12 +46,29 @@ public class CertificateAuthController {
|
|
|
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("categoryId", certificateType);
|
|
|
return modelAndView;
|
|
|
+ }
|
|
|
|
|
|
-// return JsonUtil.toMAP(true,"验证成功");
|
|
|
+ @RequestMapping("/auth")
|
|
|
+ @ResponseBody
|
|
|
+ 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, "验证码输入错误");
|
|
|
+ }
|
|
|
+ return JsonUtil.toMAP(true, "验证成功");
|
|
|
}
|
|
|
}
|