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