Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复Linux下的路径判断 #2171

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion game/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
// 处理Node环境下的http情况
if (typeof window.require == "function" && typeof window.process == "object" && typeof window.__dirname == "string") {
// 在http环境下修改__dirname和require的逻辑
if (window.__dirname.endsWith("electron.asar\\renderer")) {
if (window.__dirname.endsWith("electron.asar\\renderer") || window.__dirname.endsWith("electron.asar/renderer")) {
const path = require("path");
window.__dirname = path.join(path.resolve(), "resources/app");
const oldData = Object.entries(window.require);
Expand Down