补充店铺设置展示与编辑设计

This commit is contained in:
2026-07-23 19:48:23 +08:00
parent f7c5b34f8b
commit b965057499
2 changed files with 85 additions and 0 deletions
+12
View File
@@ -499,3 +499,15 @@
以后避免:凡是在 JayuCloud 里运行 GitNexus、`pnpm`、`npx`、`.gitnexus/run.cjs` 之类命令,先检查 `Get-Command node` 和 `node -v`;如果命中微信开发者工具 Node,立刻切换到带 PATH 前缀的 `cmd /c` 写法。
验证方式:切换前后分别执行 `node -v`,应从 `16.x` 变成 `24.x`;之后 GitNexus `impact` / `detect_changes` 与 `pnpm` 命令可正常完成。
## 2026-07-23 PowerShell 子表达式不能直接包裹 if 语句
问题:启动视觉 companion 后,在对象字面量的子表达式中直接写 `(if (Test-Path ...) { ... } else { ... })`,PowerShell 把 `if` 当成命令解析并报“找不到 if”。
原因:PowerShell 的 `if` 是语句,不是可直接作为子表达式调用的函数;复杂对象初始化和条件逻辑混在一行时更容易触发解析错误。
处理方式:条件逻辑改为先单独执行并赋值,再组装对象;服务启动、路径检查和结果输出拆成简单命令。
以后避免:不要在 `(...)`、`@{}` 或字符串插值中直接嵌入 `if` 语句;多步 PowerShell 操作按“执行 -> 赋值 -> 输出”分步写。
验证方式:先单独检查 `Test-Path` 和 `Get-Content`,确认视觉 companion 的 `state/server-info` 存在且可读,再访问浏览器 URL。