Commit 8bc9dc93651159cded025e6e2d884a3c1ed75fce

Authored by liwei2917
1 parent d5c41e9f

增加站点失败页面返回

src/main/java/com/cnlive/shenhe/controller/CommentsController.java
@@ -56,6 +56,9 @@ public class CommentsController { @@ -56,6 +56,9 @@ public class CommentsController {
56 String start_date, String end_date, String state, Integer receive, 56 String start_date, String end_date, String state, Integer receive,
57 Integer page, Integer pageSize, String orderByClause, HttpSession session) { 57 Integer page, Integer pageSize, String orderByClause, HttpSession session) {
58 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); 58 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  59 + if(CommonUtils.isNull(sessionUser)){
  60 + return "redirect:/users/login";
  61 + }
59 Integer spid = sessionUser.getSpid(); 62 Integer spid = sessionUser.getSpid();
60 String userId = sessionUser.getUserId(); 63 String userId = sessionUser.getUserId();
61 if (spid == 0) spid = null; 64 if (spid == 0) spid = null;
src/main/java/com/cnlive/shenhe/controller/VideosController.java
@@ -114,12 +114,20 @@ public class VideosController { @@ -114,12 +114,20 @@ public class VideosController {
114 @GetMapping("/page") 114 @GetMapping("/page")
115 public Object getListVideos(Model model, String video_title, String start_date, String end_date, Integer state, Integer receive, Integer page, Integer pageSize, String video_priority, String orderByClause, String sp_desc, HttpSession session) { 115 public Object getListVideos(Model model, String video_title, String start_date, String end_date, Integer state, Integer receive, Integer page, Integer pageSize, String video_priority, String orderByClause, String sp_desc, HttpSession session) {
116 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); 116 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  117 + if(CommonUtils.isNull(sessionUser)){
  118 + return "redirect:/users/login";
  119 + }
117 Integer spid = sessionUser.getSpid(); 120 Integer spid = sessionUser.getSpid();
118 String userId = sessionUser.getUserId(); 121 String userId = sessionUser.getUserId();
119 if (CommonUtils.isNull(page)) page = 1; 122 if (CommonUtils.isNull(page)) page = 1;
120 if (CommonUtils.isNull(pageSize)) pageSize = 10; 123 if (CommonUtils.isNull(pageSize)) pageSize = 10;
121 if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) { 124 if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) {
122 - spid = sitesService.findspidBySpdesc(sp_desc).getSpid(); 125 + ShySites shySite=sitesService.findspidBySpdesc(sp_desc);
  126 + if(CommonUtils.isNotNull(shySite)){
  127 + spid = shySite.getSpid();
  128 + }else{
  129 + return "page/sitesError.html";
  130 + }
123 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { 131 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
124 spid = null; 132 spid = null;
125 } 133 }
src/main/java/com/cnlive/shenhe/serviceImpl/SitesServiceImpl.java
@@ -62,10 +62,10 @@ public class SitesServiceImpl { @@ -62,10 +62,10 @@ public class SitesServiceImpl {
62 if (CommonUtils.isNotNull(spId)) 62 if (CommonUtils.isNotNull(spId))
63 criteria.andEqualTo("spid", spId); 63 criteria.andEqualTo("spid", spId);
64 List<ShySites> shySites = shySitesMapper.selectByExample(example); 64 List<ShySites> shySites = shySitesMapper.selectByExample(example);
65 - if(CommonUtils.isNotNull(shySites)){ 65 + if(CommonUtils.isNotNull(shySites)&&shySites.size()>0){
66 return shySites.get(0); 66 return shySites.get(0);
67 } 67 }
68 - return new ShySites(); 68 + return null;
69 } 69 }
70 70
71 public ShySites findspidBySpdesc(String sp_desc) { 71 public ShySites findspidBySpdesc(String sp_desc) {
@@ -74,10 +74,10 @@ public class SitesServiceImpl { @@ -74,10 +74,10 @@ public class SitesServiceImpl {
74 if (CommonUtils.isNotEmpty(sp_desc)) 74 if (CommonUtils.isNotEmpty(sp_desc))
75 criteria.andEqualTo("name", sp_desc); 75 criteria.andEqualTo("name", sp_desc);
76 List<ShySites> shySites = shySitesMapper.selectByExample(example); 76 List<ShySites> shySites = shySitesMapper.selectByExample(example);
77 - if(CommonUtils.isNotNull(shySites)){ 77 + if(CommonUtils.isNotNull(shySites)&&shySites.size()>0){
78 return shySites.get(0); 78 return shySites.get(0);
79 } 79 }
80 - return new ShySites(); 80 + return null;
81 } 81 }
82 /** 82 /**
83 * 获取免审白名单列表(点播) 83 * 获取免审白名单列表(点播)
src/main/resources/templates/page/sitesError.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <title>审核云平台</title>
  5 +
  6 + <style>
  7 + html, body {
  8 + height: 100%;
  9 + }
  10 +
  11 + body {
  12 + margin: 0;
  13 + padding: 0;
  14 + width: 100%;
  15 + display: table;
  16 + font-weight: 100;
  17 + font-family: 'Lato', sans-serif;
  18 + }
  19 +
  20 + .container {
  21 + text-align: center;
  22 + display: table-cell;
  23 + vertical-align: middle;
  24 + }
  25 +
  26 + .content {
  27 + text-align: center;
  28 + display: inline-block;
  29 + }
  30 +
  31 + .title {
  32 + font-size: 40px;
  33 + }
  34 + </style>
  35 +</head>
  36 +<body>
  37 +<div class="container">
  38 + <div class="content">
  39 + <div class="title">站点查询失败,请检查后重新查询!</div>
  40 + </div>
  41 +</div>
  42 +</body>
  43 +</html>
  44 +