Commit 1edac0ba authored by liqin's avatar liqin 💬

Merge branch 'master' of http://111.203.232.171:8888/lee/chnmuseum-party into master

parents 60b2ef84 4782adaa
...@@ -46,15 +46,20 @@ public class JwtFilter extends BasicHttpAuthenticationFilter { ...@@ -46,15 +46,20 @@ public class JwtFilter extends BasicHttpAuthenticationFilter {
@Override @Override
protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) { protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) {
LOGGER.info("isAccessAllowed"); LOGGER.info("isAccessAllowed");
if (isLoginAttempt(request, response)) { // if (isLoginAttempt(request, response)) {
//if (!isLoginAttempt(request, response) || !executeLogin(request,response)) { //if (!isLoginAttempt(request, response) || !executeLogin(request,response)) {
try { try {
executeLogin(request, response); executeLogin(request, response);
} catch (UnauthorizedException | AuthenticationException e) { return true;
throw new AuthenticationException("Token失效,请重新登录", e); } catch (UnauthorizedException e) {
// response403(request,response);
return false;
} catch (AuthenticationException ae) {
// response401(request, response);
return false;
} }
} // }
return true; // return true;
} }
/** /**
...@@ -97,8 +102,8 @@ public class JwtFilter extends BasicHttpAuthenticationFilter { ...@@ -97,8 +102,8 @@ public class JwtFilter extends BasicHttpAuthenticationFilter {
HttpServletResponse response = (HttpServletResponse) resp; HttpServletResponse response = (HttpServletResponse) resp;
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setContentType("application/json;charset=utf-8"); response.setContentType("application/json;charset=utf-8");
response.setStatus(401); response.setStatus(1109);
response.getWriter().write("{\"status\":401,\"message\":\"未登录!\"}"); response.getWriter().write("{\"resultCode\":1109,\"message\":\"账号认证失败!\"}");
} catch (IOException e) { } catch (IOException e) {
LOGGER.error(e.getMessage()); LOGGER.error(e.getMessage());
} }
......
...@@ -142,7 +142,7 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -142,7 +142,7 @@ public class ChinaMobileRestApiController extends BaseController {
@ApiOperation(value = "机顶盒激活状态查询", notes = "机顶盒激活状态查询") @ApiOperation(value = "机顶盒激活状态查询", notes = "机顶盒激活状态查询")
@GetMapping("/equitment/activity") @GetMapping("/equitment/activity")
@RequiresAuthentication //@RequiresPermissions("/equitment/activity/") //@RequiresAuthentication //@RequiresPermissions("/equitment/activity/")
public Map<String, Object> getActivity(@RequestParam(required = true) String mac) { public Map<String, Object> getActivity(@RequestParam(required = true) String mac) {
List<TBoxOperation> list = new ArrayList<>(); List<TBoxOperation> list = new ArrayList<>();
try { try {
...@@ -243,6 +243,7 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -243,6 +243,7 @@ public class ChinaMobileRestApiController extends BaseController {
@ApiOperation(value = "获取单个成员信息") @ApiOperation(value = "获取单个成员信息")
@GetMapping(value = "/user/getUserInfo") @GetMapping(value = "/user/getUserInfo")
@RequiresAuthentication
public ResponseEntity<JSONObject> getById(String userId) { public ResponseEntity<JSONObject> getById(String userId) {
JSONObject resultMap = new JSONObject(true); JSONObject resultMap = new JSONObject(true);
try { try {
...@@ -278,6 +279,7 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -278,6 +279,7 @@ public class ChinaMobileRestApiController extends BaseController {
} }
@RequestMapping(value = "/user/logout", method = RequestMethod.GET) @RequestMapping(value = "/user/logout", method = RequestMethod.GET)
@RequiresAuthentication
public ResponseEntity<JSONObject> logout() { public ResponseEntity<JSONObject> logout() {
String token = request.getHeader("Authorization"); String token = request.getHeader("Authorization");
JSONObject resultMap = new JSONObject(true); JSONObject resultMap = new JSONObject(true);
...@@ -302,6 +304,7 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -302,6 +304,7 @@ public class ChinaMobileRestApiController extends BaseController {
*/ */
@ApiOperation(value = "插入机顶盒日志表", notes = "插入机顶盒日志表") @ApiOperation(value = "插入机顶盒日志表", notes = "插入机顶盒日志表")
@PostMapping(value = "/equitment/runLog") @PostMapping(value = "/equitment/runLog")
@RequiresAuthentication
public ResponseEntity<JSONObject> insertRunLog(RunLog runLog) { public ResponseEntity<JSONObject> insertRunLog(RunLog runLog) {
JSONObject resultMap = new JSONObject(); JSONObject resultMap = new JSONObject();
...@@ -324,6 +327,7 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -324,6 +327,7 @@ public class ChinaMobileRestApiController extends BaseController {
*/ */
@ApiOperation(value = "查询语言列表", notes = "查询语言列表") @ApiOperation(value = "查询语言列表", notes = "查询语言列表")
@PostMapping(value = "/language/info") @PostMapping(value = "/language/info")
@RequiresAuthentication
public ResponseEntity<JSONObject> languageInfo() { public ResponseEntity<JSONObject> languageInfo() {
JSONObject resultMap = new JSONObject(); JSONObject resultMap = new JSONObject();
...@@ -379,6 +383,7 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -379,6 +383,7 @@ public class ChinaMobileRestApiController extends BaseController {
@ApiImplicitParam(name = "language", value = "语言", dataType = "String", paramType = "query") @ApiImplicitParam(name = "language", value = "语言", dataType = "String", paramType = "query")
}) })
@GetMapping("/exhibitionBoard/getBoardInfo") @GetMapping("/exhibitionBoard/getBoardInfo")
@RequiresAuthentication
public Map<String, Object> getById(@RequestParam(value = "boardId") String id, @RequestParam(value = "language", required = false) LanguageEnum language) { public Map<String, Object> getById(@RequestParam(value = "boardId") String id, @RequestParam(value = "language", required = false) LanguageEnum language) {
ExhibitionBoard exhibitionBoard = exhibitionBoardService.getById(id); ExhibitionBoard exhibitionBoard = exhibitionBoardService.getById(id);
String exhibitionBoardCatId = exhibitionBoard.getExhibitionBoardCatId(); String exhibitionBoardCatId = exhibitionBoard.getExhibitionBoardCatId();
......
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