Repair: Cookie language_id

This commit is contained in:
Igor I
2025-08-06 10:12:15 +05:00
parent 9ee0aca24a
commit c18e94ca48
4 changed files with 12 additions and 15 deletions

View File

@ -13,7 +13,8 @@ spring:
application: application:
name: org-ccalm-dbms name: org-ccalm-dbms
datasource: datasource:
url: jdbc:postgresql://91.201.214.156:5432/CCALM?ApplicationName=org_ccalm_dbms&ssl=true&sslmode=require&connectTimeout=10000&socketTimeout=10000 #url: jdbc:postgresql://91.201.214.156:5432/CCALM?ApplicationName=org_ccalm_dbms&ssl=true&sslmode=require&connectTimeout=10000&socketTimeout=10000
url: jdbc:postgresql://127.0.0.1:5432/CCALM?ApplicationName=org_ccalm_dbms&ssl=true&sslmode=require&connectTimeout=10000&socketTimeout=10000
username: postgres username: postgres
password: 309A86FF65A78FB428F4E38DFE35F730 password: 309A86FF65A78FB428F4E38DFE35F730
driver-class-name: org.postgresql.Driver driver-class-name: org.postgresql.Driver

View File

@ -10,7 +10,7 @@
</parent> </parent>
<groupId>org.ccalm</groupId> <groupId>org.ccalm</groupId>
<artifactId>dbms</artifactId> <artifactId>dbms</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
<name>dbms</name> <name>dbms</name>
<description>Database management system</description> <description>Database management system</description>
<url/> <url/>

View File

@ -275,7 +275,8 @@ public class DBMSRecords implements ServletContextAware {
@ModelAttribute User user, @ModelAttribute User user,
@RequestBody(required = false) byte[] reqData, @RequestBody(required = false) byte[] reqData,
@CookieValue(value = "jwt_a", defaultValue = "") String jwt_a, @CookieValue(value = "jwt_a", defaultValue = "") String jwt_a,
@RequestParam(required=false,name="lng") String language_id //@RequestParam(required=false,name="lng") String language_id
@CookieValue(value = "lng", defaultValue = "3") String language_id
) { ) {
final HttpHeaders httpHeaders= new HttpHeaders(); final HttpHeaders httpHeaders= new HttpHeaders();
httpHeaders.setContentType(MediaType.APPLICATION_JSON); httpHeaders.setContentType(MediaType.APPLICATION_JSON);
@ -300,7 +301,6 @@ public class DBMSRecords implements ServletContextAware {
user.id = claims.getBody().get("user_id").toString(); user.id = claims.getBody().get("user_id").toString();
} }
if(language_id!=null && !language_id.equals("")) if(language_id!=null && !language_id.equals(""))
user.language_id=language_id; user.language_id=language_id;
logger.info("user.id="+user.id+" user.name="+user.name+" user.language_id="+user.language_id+" user.country_id="+user.country_id); logger.info("user.id="+user.id+" user.name="+user.name+" user.language_id="+user.language_id+" user.country_id="+user.country_id);
@ -362,7 +362,6 @@ public class DBMSRecords implements ServletContextAware {
reqNode = doc.getDocumentElement(); reqNode = doc.getDocumentElement();
fn = reqNode.getAttribute("fn"); //Номер функции fn = reqNode.getAttribute("fn"); //Номер функции
} }
//logger.info(""); //logger.info("");
//logger.info("XML = "); //logger.info("XML = ");
//logger.info(toString(doc)); //logger.info(toString(doc));
@ -2271,8 +2270,6 @@ public class DBMSRecords implements ServletContextAware {
File file = new File(data_dir + "temp" + File.separator + fileName); File file = new File(data_dir + "temp" + File.separator + fileName);
if(file.exists()) if(file.exists())
{ {
//logger.info("Send report: " + fileName);
//response.setContentType("application/octet-stream"); //Commented because it is specified in the function declaration. //response.setContentType("application/octet-stream"); //Commented because it is specified in the function declaration.
response.setHeader("Content-Disposition","attachment; filename="+fileName); response.setHeader("Content-Disposition","attachment; filename="+fileName);
response.setContentLength((int) file.length()); response.setContentLength((int) file.length());

View File

@ -25,13 +25,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.context.ServletContextAware; import org.springframework.web.context.ServletContextAware;
import org.w3c.dom.DOMException; import org.w3c.dom.DOMException;
import org.w3c.dom.Document; import org.w3c.dom.Document;
@ -53,7 +47,12 @@ public class DBMSTree implements ServletContextAware {
@RequestMapping(value = "/tree",method = RequestMethod.POST,produces = "application/xml; charset=utf-8") @RequestMapping(value = "/tree",method = RequestMethod.POST,produces = "application/xml; charset=utf-8")
@ResponseBody @ResponseBody
public Object ajaxTamer(@ModelAttribute User user,@RequestBody byte[] reqData,@RequestParam(required=false,name="lng") String language_id) { public Object ajaxTamer(
@ModelAttribute User user,
@RequestBody byte[] reqData,
//@RequestParam(required=false,name="lng") String language_id
@CookieValue(value = "lng", defaultValue = "3") String language_id
) {
if(language_id!=null && !language_id.equals("")) if(language_id!=null && !language_id.equals(""))
user.language_id=language_id; user.language_id=language_id;