启动补丁:乾坤装配参数名、注册接口双前缀、/chat 残留链接清理
- main.py:Executor(sandbox, http_client=…) 参数名与构造签名不符(http=…),致乾坤沙箱装配降级 503——修正 - 注册页手写 fetch 多拼一层 v1(/api/proxy/v1/auth/register → 后端 /api/v1/v1/* 404);BACKEND_ROOT 已含 /api/v1,proxy 调用不应再带——去掉 - /chat 页 M2b 已随线性会话退役,对话主入口为 /trees(镜树);六处残留链接(首页/登录/注册跳转/错误页/404 页/管理壳)全部改指 /trees - 回归:前端 type-check + 203 passed;后端百工+API 套件 45 passed
This commit is contained in:
1 parent
3c050b923c
commit
73ad3c02b0
7 files changed
+8
-8
No files matched your search
+1
-1
@@ -114,7 +114,7 @@ async def lifespan(_app: FastAPI) -> AsyncGenerator[None, None]:
|
||||
sandbox_http = httpx.AsyncClient(trust_env=False)
|
||||
sandbox = SandboxClient(sandbox_http, settings)
|
||||
_app.state.baigong_sandbox = sandbox
|
||||
_app.state.baigong_executor = Executor(sandbox, http_client=sandbox_http)
|
||||
_app.state.baigong_executor = Executor(sandbox, http=sandbox_http)
|
||||
log_with_context("百工执行器就绪(乾坤沙箱已接入)")
|
||||
except Exception as exc: # noqa: BLE001 — 配置缺失降级,不阻断启动
|
||||
_app.state.baigong_sandbox = None
|
||||
|
||||
@@ -45,7 +45,7 @@ export default function Error({
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={() => router.push("/chat")}
|
||||
onClick={() => router.push("/trees")}
|
||||
>
|
||||
返回对话
|
||||
</Button>
|
||||
|
||||
@@ -13,7 +13,7 @@ export default function NotFound() {
|
||||
此处镜面未显影,路径可能已变更或不存在。
|
||||
</p>
|
||||
<Link
|
||||
href="/chat"
|
||||
href="/trees"
|
||||
className="mt-2 inline-flex h-9 items-center rounded-xl bg-patina px-4 text-sm font-medium text-white shadow-lg shadow-patina/25 transition-all hover:bg-patina/90 active:scale-[0.97]"
|
||||
>
|
||||
返回对话
|
||||
|
||||
@@ -146,7 +146,7 @@ function LoginForm() {
|
||||
await login({ username, password });
|
||||
setDeparting(true);
|
||||
await new Promise((r) => setTimeout(r, 400));
|
||||
const redirect = searchParams.get("redirect") || "/chat";
|
||||
const redirect = searchParams.get("redirect") || "/trees";
|
||||
router.push(redirect);
|
||||
} catch (err) {
|
||||
const msg =
|
||||
|
||||
@@ -8,7 +8,7 @@ export const dynamic = "force-dynamic";
|
||||
|
||||
const QUICK_LINKS = [
|
||||
{
|
||||
href: "/chat",
|
||||
href: "/trees",
|
||||
label: "对话",
|
||||
desc: "与数字生命交谈",
|
||||
gradient: "from-patina/20 to-patina/5",
|
||||
|
||||
@@ -91,7 +91,7 @@ function RegisterForm() {
|
||||
setError(null);
|
||||
try {
|
||||
// 调用后端注册端点
|
||||
const resp = await fetch("/api/proxy/v1/auth/register", {
|
||||
const resp = await fetch("/api/proxy/auth/register", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
@@ -106,7 +106,7 @@ function RegisterForm() {
|
||||
}
|
||||
// 注册成功,自动登录
|
||||
await login({ username: username.trim(), password });
|
||||
router.push("/chat");
|
||||
router.push("/trees");
|
||||
} catch (err) {
|
||||
setError(err instanceof Error ? err.message : "注册失败");
|
||||
} finally {
|
||||
|
||||
@@ -184,7 +184,7 @@ export function AdminShell({ children }: { children: ReactNode }) {
|
||||
|
||||
{/* 返回主域 — 设计稿 topbar-back */}
|
||||
<Link
|
||||
href="/chat"
|
||||
href="/trees"
|
||||
className="flex shrink-0 items-center gap-1 rounded-lg px-2 py-1 text-xs font-medium text-muted transition-colors hover:bg-overlay-hover hover:text-fg"
|
||||
title="返回主域"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user