* [misc] check clientCache config before request.

This commit is contained in:
sunhao
2024-07-01 10:23:17 +08:00
committed by 孙广明
parent 240f5b2522
commit b51e25afa2
+1 -2
View File
@@ -497,8 +497,7 @@
const headers = {'X-ZIN-Options': JSON.stringify($.extend({selector: selectors, type: 'list'}, options.zinOptions)), 'X-ZIN-App': currentCode, 'X-Zin-Cache-Time': 0};
if(options.modal) headers['X-Zui-Modal'] = 'true';
const requestMethod = (options.method || 'GET').toUpperCase();
if(!options.cache && options.cache !== false) options.cache = requestMethod === 'GET' ? (url + (url.includes('?') ? '&zin=' : '?zin=') + encodeURIComponent(selectors.join(','))) : false;
options.cache = false; // Disable local cache for 20.1.
if(!options.cache && options.cache !== false) options.cache = (requestMethod === 'GET' && config.clientCache) ? (url + (url.includes('?') ? '&zin=' : '?zin=') + encodeURIComponent(selectors.join(','))) : false;
const cacheKey = options.cache;
let cache;
const renderPageData = (data, onlyZinDebug) =>