全能创作闸门与多人物定妆收口

主页已填卖点跳过卖点确认;按图片内容创作不再重复问品牌品名;方案卡支撑改为 P0/P1/P2;多人物视频一次生成多张定妆图并在出片前校验数量;超管登录直进后台。
This commit is contained in:
Azmat@qq.com
2026-09-22 10:02:47 +08:00
parent 2889c92c34
commit 2745760d33
6 changed files with 640 additions and 114 deletions
+24 -7
View File
@@ -358,13 +358,23 @@ export function App() {
}, [page, route.projectId, route.productId]);
// 平台后台 gating(身份就绪后):
// - 平台超管且无团队:任何非 admin 路由都送进 /admin(否则普通外壳因 !team 永久卡 loading)
// - 平台超管打开站点根路径 / 登录页:直接进 /admin,不先落全能创作再点侧栏
// - 无团队的超管:任何非 admin 路由都送进 /admin(否则普通外壳因 !team 永久卡 loading)
// - 非超管访问 /admin/*:纠回工作台
// 已有团队的超管从后台点「返回工作台」会落到 /omni-create,这里不拦。
useLayoutEffect(() => {
if (booting || !user?.is_platform_admin || route.admin !== undefined) return;
const path = window.location.pathname.replace(/\/+$/, "") || "/";
const defaultEntry = path === "/" || path === "/login" || path === "/dashboard";
if (!team || defaultEntry) {
navigateAdmin("", { replace: true });
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [booting, user, team, route.admin]);
useEffect(() => {
if (booting || !user) return;
if (user.is_platform_admin && !team && route.admin === undefined) {
navigateAdmin("", { replace: true });
} else if (!user.is_platform_admin && route.admin !== undefined) {
if (!user.is_platform_admin && route.admin !== undefined) {
navigate("omniCreate", { replace: true });
}
// navigate/navigateAdmin 为组件内函数,故意不入依赖避免每次渲染重跑
@@ -386,9 +396,12 @@ export function App() {
useLayoutEffect(() => {
if (booting || !user || page !== "dashboard") return;
if (route.admin !== undefined) return;
const path = window.location.pathname.replace(/\/+$/, "") || "/";
// 同一次渲染里超管入口已经改去 /admin,这里不能再改写成全能创作。
if (user.is_platform_admin && (path === "/" || path === "/login" || path === "/dashboard" || !team)) return;
navigate("omniCreate", { replace: true });
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [booting, user, page, route.admin]);
}, [booting, user, team, page, route.admin]);
// Load preferences + sessions when entering settings.
// 进创作相关页时重拉模型目录,避免后台刚改能力/积分,前端还捧着首屏缓存
@@ -888,10 +901,14 @@ export function App() {
setTeam(payload.team);
setRole(payload.role || "");
setBooting(false);
// 平台超管且无团队:直落后台,不拉团队级数据(否则 products/projects 等接口因无团队报错)
if (payload.user.is_platform_admin && !payload.team) {
// 平台超管登录后直接进后台。有团队时后台补拉工作台数据,供「返回工作台」使用;
// 无团队则不拉团队级接口(products/projects 会因无团队报错)。
if (payload.user.is_platform_admin) {
setAuthed(true);
navigateAdmin("", { replace: true });
if (payload.team) {
loadDataWithRetry().catch((error) => console.error("[login] data hydrate failed:", error));
}
return;
}
navigate("omniCreate", { replace: true });