up
This commit is contained in:
+4
-1
@@ -2,8 +2,11 @@
|
|||||||
# Colocar este archivo en: /api/.htaccess
|
# Colocar este archivo en: /api/.htaccess
|
||||||
|
|
||||||
<IfModule mod_headers.c>
|
<IfModule mod_headers.c>
|
||||||
# Deshabilitar buffering para SSE
|
# Deshabilitar caché para todas las respuestas de API
|
||||||
Header set Cache-Control "no-cache, no-store, must-revalidate"
|
Header set Cache-Control "no-cache, no-store, must-revalidate"
|
||||||
|
Header set Pragma "no-cache"
|
||||||
|
Header set Expires "0"
|
||||||
|
# Deshabilitar buffering para SSE
|
||||||
Header set X-Accel-Buffering "no"
|
Header set X-Accel-Buffering "no"
|
||||||
Header set Connection "keep-alive"
|
Header set Connection "keep-alive"
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ require_once '../config/config.php';
|
|||||||
requireAuthentication();
|
requireAuthentication();
|
||||||
|
|
||||||
header('Content-Type: application/json; charset=utf-8');
|
header('Content-Type: application/json; charset=utf-8');
|
||||||
|
header('Cache-Control: no-cache, no-store, must-revalidate');
|
||||||
|
header('Pragma: no-cache');
|
||||||
|
header('Expires: 0');
|
||||||
header('Access-Control-Allow-Origin: *');
|
header('Access-Control-Allow-Origin: *');
|
||||||
header('Access-Control-Allow-Methods: GET');
|
header('Access-Control-Allow-Methods: GET');
|
||||||
header('Access-Control-Allow-Headers: Content-Type');
|
header('Access-Control-Allow-Headers: Content-Type');
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
require_once '../config/config.php';
|
require_once '../config/config.php';
|
||||||
requireAuthentication();
|
requireAuthentication();
|
||||||
header('Content-Type: application/json; charset=utf-8');
|
header('Content-Type: application/json; charset=utf-8');
|
||||||
|
header('Cache-Control: no-cache, no-store, must-revalidate');
|
||||||
|
header('Pragma: no-cache');
|
||||||
|
header('Expires: 0');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$db = Database::getInstance();
|
$db = Database::getInstance();
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
require_once '../config/config.php';
|
require_once '../config/config.php';
|
||||||
|
|
||||||
header('Content-Type: application/json; charset=utf-8');
|
header('Content-Type: application/json; charset=utf-8');
|
||||||
|
header('Cache-Control: no-cache, no-store, must-revalidate');
|
||||||
|
header('Pragma: no-cache');
|
||||||
|
header('Expires: 0');
|
||||||
header('Access-Control-Allow-Origin: *');
|
header('Access-Control-Allow-Origin: *');
|
||||||
header('Access-Control-Allow-Methods: GET');
|
header('Access-Control-Allow-Methods: GET');
|
||||||
header('Access-Control-Allow-Headers: Content-Type');
|
header('Access-Control-Allow-Headers: Content-Type');
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ require_once '../config/config.php';
|
|||||||
requireAuthentication();
|
requireAuthentication();
|
||||||
|
|
||||||
header('Content-Type: application/json; charset=utf-8');
|
header('Content-Type: application/json; charset=utf-8');
|
||||||
|
header('Cache-Control: no-cache, no-store, must-revalidate');
|
||||||
|
header('Pragma: no-cache');
|
||||||
|
header('Expires: 0');
|
||||||
header('Access-Control-Allow-Origin: *');
|
header('Access-Control-Allow-Origin: *');
|
||||||
header('Access-Control-Allow-Methods: GET');
|
header('Access-Control-Allow-Methods: GET');
|
||||||
header('Access-Control-Allow-Headers: Content-Type');
|
header('Access-Control-Allow-Headers: Content-Type');
|
||||||
|
|||||||
+4
-3
@@ -2384,7 +2384,8 @@ if (!isset($_SESSION['user_id'])) {
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
credentials: 'same-origin' // Incluir cookies de sesión
|
credentials: 'same-origin', // Incluir cookies de sesión
|
||||||
|
cache: 'no-store' // Evitar caché del navegador
|
||||||
};
|
};
|
||||||
|
|
||||||
// Si se pasa body, asumimos POST (y serializamos)
|
// Si se pasa body, asumimos POST (y serializamos)
|
||||||
@@ -4366,7 +4367,7 @@ if (!isset($_SESSION['user_id'])) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Load autoresponses (text quick replies)
|
// Load autoresponses (text quick replies)
|
||||||
const respText = await apiCall('get_autoresponses.php');
|
const respText = await this.apiCall('get_autoresponses.php');
|
||||||
if (respText && respText.success && Array.isArray(respText.data)) {
|
if (respText && respText.success && Array.isArray(respText.data)) {
|
||||||
let added = 0;
|
let added = 0;
|
||||||
respText.data.forEach(r => {
|
respText.data.forEach(r => {
|
||||||
@@ -4393,7 +4394,7 @@ if (!isset($_SESSION['user_id'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const resp = await apiCall('get_templates.php?approved_only=1&limit=30');
|
const resp = await this.apiCall('get_templates.php?approved_only=1&limit=30');
|
||||||
if (resp && resp.success && Array.isArray(resp.data)) {
|
if (resp && resp.success && Array.isArray(resp.data)) {
|
||||||
let added = 0;
|
let added = 0;
|
||||||
resp.data.forEach(t => {
|
resp.data.forEach(t => {
|
||||||
|
|||||||
Reference in New Issue
Block a user