[🛠️ Fix] Invalid log dir path (#24) & Remove PLS trust token

1. [-] 删除了 PLS 的 Trust token 认证机制
2. [+] 现在可以在 `偏好设置` - `调试选项` 中直接打开日志文件夹了
3. [/] 日志目录不再使用 `%USERPROFILE%\Documents\HugoAura\logs` 为基准, 而是从注册表获取值
4. [/] 配置文件目录同理, 旧版配置文件将会自动迁移到新位置
This commit is contained in:
Minoricew
2025-06-16 21:24:10 +08:00
parent dae0f033a5
commit a638a29cc6
13 changed files with 274 additions and 88 deletions

View File

@@ -0,0 +1,40 @@
const IPC_METHOD_BASE = "$aura.debug";
const debugSettings = [
{
id: 0,
categoryName: "日志与输出",
child: [
{
index: 0,
id: "openHugoAuraLogDir",
type: "button",
style: "outline",
name: "HugoAura 日志目录",
description: "",
restart: false,
reload: false,
associateVal: null,
auraIf: () => true,
buttonContent: "打开",
valueGetter: async () => {
const ipcRendererRet = await ipcRenderer.invoke(
`${IPC_METHOD_BASE}.getLogDirAsync`
);
if (ipcRendererRet.success && ipcRendererRet.data !== "") {
global.__HUGO_AURA__.logDir = ipcRendererRet.data;
return "目录位置: " + ipcRendererRet.data;
} else {
return "未能获取日志目录位置";
}
},
callbackFn: async (event) => {
const childProc = require("child_process");
childProc.spawn(`explorer.exe`, [`${global.__HUGO_AURA__.logDir}`]);
},
},
],
},
];
module.exports = { debugSettings };