docs(review): 平台全量代码 review 报告(认证团队/AI链路/资产计费/Admin/前端/工程安全)+ 清理调试脚本

6 维度并行审查汇总:总评 + P0(上线前必修:密钥[有意保留]/内容审核/审计可查/二次确认/安全基线/数据一致性)
+ P1(Admin 补全:仪表盘/登录日志/导出/批量/审计筛选;团队找回密码/owner转移/多团队/权限细粒度)
+ P2 + 亮点。报告:docs/todo/平台代码review-2026-06-19.md

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
seaislee1209
2026-06-19 23:57:33 +08:00
co-authored by Claude Opus 4.8
parent e702cb7433
commit ad96acfacd
3 changed files with 65 additions and 40 deletions
-21
View File
@@ -1,21 +0,0 @@
import { chromium } from "playwright";
const TOK = process.argv[2];
const b = await chromium.launch();
const ctx = await b.newContext({ viewport: { width: 1440, height: 900 } });
const p = await ctx.newPage();
const errs = [];
p.on("console", m => { if (m.type()==="error") errs.push(m.text().slice(0,120)); });
p.on("pageerror", e => errs.push("PAGEERR: "+e.message.slice(0,150)));
await p.goto("http://127.0.0.1:5173/", { waitUntil: "domcontentloaded" });
await p.evaluate((t) => localStorage.setItem("airshelf_token", t), TOK);
for (const url of ["http://127.0.0.1:5173/model-photo", "http://127.0.0.1:5173/model-photo/demo-a"]) {
errs.length = 0;
await p.goto(url, { waitUntil: "networkidle" });
await p.waitForTimeout(700);
const info = await p.evaluate(() => {
const txt = document.body.innerText || "";
return { isLogin: txt.includes("AUTH/LOGIN") || txt.includes("使用团队邀请邮箱"), firstWords: txt.replace(/\s+/g," ").slice(0,80) };
});
console.log(url.split("5173")[1], JSON.stringify(info), "ERR:", errs.slice(0,3));
}
await b.close();
-19
View File
@@ -1,19 +0,0 @@
import { chromium } from "playwright";
const TOK = process.argv[2];
const b = await chromium.launch();
const ctx = await b.newContext({ viewport:{width:1440,height:900} });
const p = await ctx.newPage();
await p.goto("http://127.0.0.1:5173/", { waitUntil:"domcontentloaded" });
await p.evaluate((t)=>localStorage.setItem("airshelf_token",t), TOK);
// mirror model-photo
await p.goto("http://127.0.0.1:5173/exact/model-photo.html", { waitUntil:"networkidle" });
await p.waitForTimeout(1800);
const mirror = await p.evaluate(()=>{
const items=[...document.querySelectorAll(".mp-ps-item, .ps-item, [class*='ps-item'], .pl-item")].map(e=>e.innerText.replace(/\s+/g,' ').slice(0,30));
return { count: items.length, items: items.slice(0,10) };
});
console.log("MIRROR model-photo product list:", JSON.stringify(mirror));
// real API
const api = await p.evaluate(async (t)=>{ const r=await fetch("/api/products/",{headers:{Authorization:"Token "+t}}); const d=await r.json(); return (d.results||[]).map(x=>x.title); }, TOK);
console.log("REAL /api/products/:", JSON.stringify(api));
await b.close();