修复 R124 企业微信移动入口与部署迁移门禁

这个提交包含在:
2026-05-08 14:09:04 +08:00
父节点 377c76b5aa
当前提交 b78e82edab
共修改 14 个文件,包含 1375 行新增和 32 行删除
+28
查看文件
@@ -16,6 +16,9 @@ const scanRoots = [
const sourceExtensions = new Set([".js", ".jsx", ".ts", ".tsx"]);
const forbiddenCopy = ["先处理", "清爽"];
const userFacingBusinessTermFiles = new Set([
"client/src/pages/MobileCapturePage.tsx",
"client/src/pages/MobileNotificationsPage.tsx",
"client/src/pages/MobileProfilePage.tsx",
"client/src/pages/MobileReimbursementDetailPage.tsx",
"client/src/pages/ReimbursementDetailPage.tsx",
"client/src/components/travel/TravelPaymentTrackCard.tsx",
@@ -127,6 +130,30 @@ function scanNativeFileInputs(file, source) {
}
}
function scanMobileCapturePdfInputs(file, source) {
const normalized = toPosix(path.relative(rootDir, file));
if (normalized !== "client/src/pages/MobileCapturePage.tsx") {
return;
}
const fileInputPattern = /<input\b[^>]*\btype=["']file["'][^>]*>/g;
let match = fileInputPattern.exec(source);
while (match) {
const inputSource = match[0];
if (/application\/pdf/i.test(inputSource) && /\bcapture\b/i.test(inputSource)) {
addFinding({
rule: "form.no_pdf_capture_input",
severity: "error",
file,
line: lineNumber(source, match.index),
message: "PDF 上传入口不能带 capture,否则企业微信容易直接打开摄像头。",
evidence: inputSource.replace(/\s+/g, " ").slice(0, 160),
});
}
match = fileInputPattern.exec(source);
}
}
function scanUserFacingBusinessTerms(file, source) {
const normalized = toPosix(path.relative(rootDir, file));
if (!userFacingBusinessTermFiles.has(normalized)) {
@@ -226,6 +253,7 @@ function scanFile(file) {
scanUserFacingBusinessTerms(file, source);
scanMobileDarkControls(file, source);
scanNativeFileInputs(file, source);
scanMobileCapturePdfInputs(file, source);
scanRawBusinessIdentifiers(file, source);
scanNavigationTitleCoverage(file, source);
}