fix: 修复桌面检查脚本的 Windows 路径判断

This commit is contained in:
Cheng Zhou
2026-07-09 09:38:55 +08:00
parent b03e30d0dd
commit f4844aa8f1
2 changed files with 8 additions and 4 deletions
+2 -1
View File
@@ -29,6 +29,7 @@ const walk = async (directory) => {
const permissionIdentifier = (permission) =>
typeof permission === "string" ? permission : typeof permission?.identifier === "string" ? permission.identifier : "";
const toPosixPath = (path) => path.split("\\").join("/");
const assertPathScope = (permission, expectedPrefix, description) => {
const allow = Array.isArray(permission.allow) ? permission.allow : [];
@@ -205,7 +206,7 @@ const verifySourceSafety = async () => {
for (const path of files) {
const source = await readFile(path, "utf8");
const file = relative(rootDir, path);
const file = toPosixPath(relative(rootDir, path));
const isRuntimeFile = file.startsWith("frontend/src/runtime/");
assert(!/[?&](?:token|access_token)=/i.test(source), `${file}: token must not be passed through query parameters.`);
assert(