Update: 规范化项目结构

This commit is contained in:
2025-09-03 21:02:41 +08:00
parent d3e9cf5240
commit 2fea99a7e2
13 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2025 Kisechan
Copyright (c) 2025 Kisechan <admin@kisechan.space>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

View File

@ -24,14 +24,14 @@ ipcMain.on("play-sound", (_, soundFile) => {
// 在开发模式下,直接指向 renderer/public 里的文件
soundPath = path.join(
__dirname,
"../renderer/public/assets/sounds",
"../renderer/public/sounds",
soundFile
);
} else {
// 在生产模式下Vite 会把 public 里的文件复制到 dist 文件夹
soundPath = path.join(
__dirname,
"../renderer/dist/assets/sounds",
"../renderer/dist/sounds",
soundFile
);
}
@ -51,13 +51,13 @@ ipcMain.handle("get-sound-path", (_, soundFile) => {
if (process.env.NODE_ENV === "development") {
soundPath = path.join(
__dirname,
"../renderer/public/assets/sounds",
"../renderer/public/sounds",
soundFile
);
} else {
soundPath = path.join(
__dirname,
"../renderer/dist/assets/sounds",
"../renderer/dist/sounds",
soundFile
);
}
@ -74,8 +74,8 @@ ipcMain.handle("get-sound-path", (_, soundFile) => {
ipcMain.handle("get-sound-files", async () => {
const soundDir =
process.env.NODE_ENV === "development"
? path.join(__dirname, "../renderer/public/assets/sounds")
: path.join(__dirname, "../renderer/dist/assets/sounds");
? path.join(__dirname, "../renderer/public/sounds")
: path.join(__dirname, "../renderer/dist/sounds");
try {
// 读取目录下的所有文件名

View File

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB