From 9f529e4ba30644c02d2dda3b0bbdf2a4dce66b49 Mon Sep 17 00:00:00 2001 From: "douboer@gmail.com" Date: Sat, 14 Feb 2026 10:12:50 +0800 Subject: [PATCH] update at 2026-02-14 10:12:50 --- miniapp/utils/sankey.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/miniapp/utils/sankey.js b/miniapp/utils/sankey.js index 2475d60..0f86ba5 100644 --- a/miniapp/utils/sankey.js +++ b/miniapp/utils/sankey.js @@ -19,7 +19,12 @@ function getXlsxModule() { try { cachedXlsxModule = require('xlsx'); } catch (error) { - cachedXlsxModule = null; + // 兜底:兼容开发者工具未正确挂载 npm 解析时,直接从 miniprogram_npm 目录加载。 + try { + cachedXlsxModule = require('../miniprogram_npm/xlsx'); + } catch (fallbackError) { + cachedXlsxModule = null; + } } return cachedXlsxModule; }