文件操作 - track.js
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/extendify/src/Shared/lib/track.js
编辑文件内容
import { INSIGHTS_HOST } from '@constants'; import { reqDataBasics } from '@shared/lib/data'; const HEADERS = { 'Content-type': 'application/json', Accept: 'application/json', 'X-Extendify': 'true', }; const ENDPOINT = `${INSIGHTS_HOST}/api/v1/event`; export const track = (key, payload = {}) => { if (!INSIGHTS_HOST || !key) return; const { siteId, partnerId, homeUrl, siteCreatedAt } = reqDataBasics; try { fetch(ENDPOINT, { method: 'POST', headers: HEADERS, keepalive: true, body: JSON.stringify({ insightsId: siteId, key, payload, partnerId, siteURL: homeUrl, siteCreatedAt, }), }).catch(() => { /* swallow */ }); } catch (_e) { /* swallow */ } };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件