Authorization test
This commit is contained in:
@ -352,10 +352,20 @@ public class MainController implements ServletContextAware {
|
|||||||
@RequestMapping(value = "/",method = RequestMethod.GET,produces = "application/json;charset=utf-8")
|
@RequestMapping(value = "/",method = RequestMethod.GET,produces = "application/json;charset=utf-8")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseEntity<Object> index(
|
public ResponseEntity<Object> index(
|
||||||
@CookieValue(value = "lng", defaultValue = "1") String language_id
|
@CookieValue(value = "lng", defaultValue = "1") String language_id,
|
||||||
|
HttpServletRequest request
|
||||||
) {
|
) {
|
||||||
Translation trt = new Translation(language_id,jdbcTemplate);
|
Translation trt = new Translation(language_id,jdbcTemplate);
|
||||||
try {
|
try {
|
||||||
|
// Извлекаем заголовок Authorization
|
||||||
|
/*String authorizationHeader = request.getHeader("Authorization");
|
||||||
|
if (authorizationHeader != null && authorizationHeader.startsWith("Bearer ")) {
|
||||||
|
String token = authorizationHeader.substring(7); // Убираем "Bearer " из строки
|
||||||
|
System.out.println("Authorization Bearer Token: " + token);
|
||||||
|
} else {
|
||||||
|
System.out.println("Authorization Bearer Token: Not found or invalid");
|
||||||
|
}*/
|
||||||
|
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("error_code",0);
|
json.put("error_code",0);
|
||||||
json.put("error_message","");
|
json.put("error_message","");
|
||||||
|
|||||||
Reference in New Issue
Block a user