全能创作闸门与多人物定妆收口
主页已填卖点跳过卖点确认;按图片内容创作不再重复问品牌品名;方案卡支撑改为 P0/P1/P2;多人物视频一次生成多张定妆图并在出片前校验数量;超管登录直进后台。
This commit is contained in:
@@ -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 });
|
||||
|
||||
@@ -1044,7 +1044,7 @@ function PlanCard({ payload }: { payload: Record<string, unknown> }) {
|
||||
const timeline = (payload.timeline as PlanTimelineItem[] | undefined) || [];
|
||||
const voice = coerceVoiceChars(payload.voice_chars);
|
||||
const format = (value: number) => (Number.isInteger(value) ? String(value) : value.toFixed(1));
|
||||
const pointLabels = ["核心支撑 P0", "视觉支撑 P0", "转化支撑 P0"];
|
||||
const pointLabels = ["核心支撑 P0", "视觉支撑 P1", "转化支撑 P2"];
|
||||
|
||||
return (
|
||||
<section className="omni-video-plan-card">
|
||||
@@ -1417,7 +1417,7 @@ function ElicitCard({
|
||||
placeholder={
|
||||
isPet
|
||||
? "例如:呆萌可爱的金毛幼犬,毛发蓬松干净,系着小红领巾,眼神灵动"
|
||||
: "例如:25岁左右女性,短发,干练通勤风,表情自然"
|
||||
: "单人例如:25岁女性,短发通勤风。多人物可写:角色1:年轻空乘短发;角色2:中年旅客长发"
|
||||
}
|
||||
onChange={(event) => setPersonPrompt(event.target.value)}
|
||||
/>
|
||||
@@ -1425,7 +1425,7 @@ function ElicitCard({
|
||||
<span>
|
||||
{isPet
|
||||
? "不填写也可以,平台会结合当前商品和拟人主题自动设计萌宠角色。"
|
||||
: "不填写也可以,平台会结合当前商品和创作主题自动设计角色。"}
|
||||
: "不填写也可以。若脚本是多人物,平台会按人数一次生成多张定妆图,避免长视频前后形象漂移。"}
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user