node 适配

This commit is contained in:
shenjack-5600u 2024-04-02 01:10:59 +08:00
parent 7909f2b9d0
commit 51c97517b9
Signed by: shenjack
GPG Key ID: FDF9864E11C7E79F

View File

@ -2,7 +2,10 @@
// let window = window; // let window = window;
let name_input = "test\ntest2"; let name_input = "test\ntest2";
let assets_data; let assets_data = {
lang: null,
gAd: null,
};
let from_node = typeof window == "undefined"; let from_node = typeof window == "undefined";
if (from_node) { if (from_node) {
@ -44,10 +47,8 @@ if (from_node) {
let gAd_path = path.join(assets_path, "gAd.md"); let gAd_path = path.join(assets_path, "gAd.md");
let gAd_data = fs.readFileSync(gAd_path, "utf-8"); let gAd_data = fs.readFileSync(gAd_path, "utf-8");
assets_data = { assets_data.lang = lang_data;
"lang": lang_data, assets_data.gAd = gAd_data;
"gAd": gAd_data,
}
} }
let why_ns = 0; let why_ns = 0;
@ -7896,7 +7897,9 @@ var A = {
} }
case 2: case 2:
if (from_node) { if (from_node) {
console.log("from_node", from_node) console.log("loading gAd data")
// 暂时有问题, 还得调试
LangData.v1(t.cF.a(C.C.bt(0, assets_data.gAd)))
} else { } else {
p = window.sessionStorage.getItem(LangData.eQ("ll")) p = window.sessionStorage.getItem(LangData.eQ("ll"))
if (typeof p == "string") LangData.v1(t.cF.a(C.C.bt(0, p))) if (typeof p == "string") LangData.v1(t.cF.a(C.C.bt(0, p)))