Не знаю что
This commit is contained in:
@ -99,15 +99,15 @@ public class DBMSRecords implements ServletContextAware {
|
||||
|
||||
public String sendError(int code, String message) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("errorCode",code);
|
||||
json.put("errorMessage",message);
|
||||
json.put("error_code",code);
|
||||
json.put("error_message",message);
|
||||
return json.toString();
|
||||
}
|
||||
|
||||
//Документация по @RequestBody http://javastudy.ru/spring-mvc/json-xml/ application/xml
|
||||
@RequestMapping(value = "/records.php",method = {RequestMethod.POST,RequestMethod.GET},produces = "text/plain; charset=utf-8")
|
||||
@RequestMapping(value = "/monitoring/records.php",method = {RequestMethod.POST,RequestMethod.GET},produces = "text/plain; charset=utf-8")
|
||||
@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(required = false) byte[] reqData,@RequestParam(required=false,name="lng") String language_id) {
|
||||
|
||||
if(language_id!=null && !language_id.equals(""))
|
||||
user.language_id=language_id;
|
||||
@ -115,6 +115,9 @@ public class DBMSRecords implements ServletContextAware {
|
||||
|
||||
boolean error=false;
|
||||
String result=sendError(1,"Request not processed!");
|
||||
if(reqData==null)
|
||||
return result;
|
||||
|
||||
//response.setCharacterEncoding("UTF-8");
|
||||
|
||||
//response.getWriter().append("Served at: ").append(request.getContextPath());
|
||||
|
||||
@ -1204,27 +1204,7 @@ class EdtRec
|
||||
this.hideProgressBar();
|
||||
|
||||
if(node.errorCode>0) {
|
||||
let fullText = node.errorMessage;
|
||||
let smallText = '';
|
||||
let pos1=fullText.indexOf('[[');
|
||||
let pos2=fullText.indexOf(']]');
|
||||
if(pos1>=0 && pos2>=0 && pos1<pos2) smallText=fullText.substring(pos1+2, pos2);
|
||||
|
||||
if(fullText.indexOf("id456[[")>=0){ //Если есть идентификатор того что это перезапись
|
||||
let okFunc=()=>{
|
||||
this.setValue('seq',0);
|
||||
this.sendData(); //Применить ещё раз
|
||||
};
|
||||
if (smallText != '')
|
||||
confirm2(trt('Warning'),smallText, fullText, okFunc, null);
|
||||
else
|
||||
confirm2(trt('Warning'),smallText, '', okFunc, null);
|
||||
}else {
|
||||
if (smallText != '')
|
||||
alert2(trt('Alert'), smallText, fullText);
|
||||
else
|
||||
alert2(trt('Alert'), fullText);
|
||||
}
|
||||
alert2(trt('Alert'), node.errorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -19,8 +19,10 @@ class DBMSUser
|
||||
applyReq(req,fn,node)
|
||||
{
|
||||
this.showShadow(false);
|
||||
|
||||
if(node.errorCode>0) {
|
||||
alert2(trt('Alert'), node.errorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
if(fn==7)
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
}else
|
||||
if($fn=='1')
|
||||
{
|
||||
@session_start();
|
||||
@session_start(['cookie_lifetime' => 43200,'cookie_secure' => true,'cookie_httponly' => true]);
|
||||
echo session_id();
|
||||
exit;
|
||||
}else
|
||||
|
||||
@ -52,26 +52,7 @@ class SRec
|
||||
this.hideProgressBar();
|
||||
|
||||
if(node.errorCode>0) {
|
||||
let fullText = node.errorMessage;
|
||||
let smallText = '';
|
||||
let pos1=fullText.indexOf('[[');
|
||||
let pos2=fullText.indexOf(']]');
|
||||
if(pos1>=0 && pos2>=0 && pos1<pos2) smallText=fullText.substring(pos1+2, pos2);
|
||||
if(fullText.indexOf("id456[[")>=0){ //Если есть идентификатор того что это перезапись
|
||||
let okFunc=()=>{
|
||||
this.setValue('seq',0);
|
||||
this.sendData(); //Применить ещё раз
|
||||
};
|
||||
if (smallText != '')
|
||||
confirm2(trt('Warning'),smallText, fullText, okFunc, null);
|
||||
else
|
||||
confirm2(trt('Warning'),smallText, '', okFunc, null);
|
||||
}else {
|
||||
if (smallText != '')
|
||||
alert2(trt('Alert'), smallText, fullText);
|
||||
else
|
||||
alert2(trt('Alert'), fullText);
|
||||
}
|
||||
alert2(trt('Alert'), node.errorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -244,6 +244,10 @@ function alert2(title,smallText,fullText,okFunc=null)
|
||||
smallText=fullText;
|
||||
fullText='';
|
||||
}
|
||||
let pos1=smallText.indexOf('[[');
|
||||
let pos2=smallText.indexOf(']]');
|
||||
if(pos1>=0 && pos2>=0 && pos1<pos2) smallText=smallText.substring(pos1+2, pos2);
|
||||
|
||||
let win=new TWin(true);
|
||||
win.BuildGUI(10,10);
|
||||
win.setCaption(document.createTextNode(title));
|
||||
|
||||
Reference in New Issue
Block a user