Browse Source

merge: 合并最新代码

master
Senor-Liu 1 month ago
parent
commit
e921fcbdc5
  1. 2
      web/client/src/layout/components/header.jsx
  2. 20
      web/client/src/sections/aiTenderDocument/container/index.module.less
  3. 2
      web/client/src/sections/articleSelect/actions/request.jsx
  4. 2
      web/client/src/sections/financeInvoice/components/FinanceInvoiceWorkspace.jsx
  5. 23
      web/client/src/sections/superAgent/container/index.jsx
  6. 10
      web/client/src/sections/superAgent/container/index.less
  7. 9
      web/client/src/sections/superAgent/hooks/useSuperAgentStream.js
  8. 6
      web/client/src/utils/index.js

2
web/client/src/layout/components/header.jsx

@ -30,7 +30,7 @@ export default function header () {
items: [{
label: <div onClick={() => {
clearCompatibleAuthInfo();
navigate("/chat");
navigate("/aichat");
}}>
退出登录
</div>,

20
web/client/src/sections/aiTenderDocument/container/index.module.less

@ -9,7 +9,25 @@
box-sizing: border-box;
}
.embeddedContainer {
background: transparent;
background: #fff;
scrollbar-width: none;
-ms-overflow-style: none;
}
.embeddedContainer::-webkit-scrollbar,
.embeddedContainer :global(*)::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
}
.embeddedContainer :global(*) {
scrollbar-width: none;
-ms-overflow-style: none;
}
.embeddedContainer .mainLayout {
background: #fff;
}
.navSider {
background-image: linear-gradient(180deg, #f9fbff 0%, #e0eaff 99%);

2
web/client/src/sections/articleSelect/actions/request.jsx

@ -11,7 +11,7 @@ export const apiRequest = new request({
if (err) {
if (err?.status === 401) {
clearCompatibleAuthInfo()
window.location.replace('/chat');
window.location.replace('/aichat');
}
return err
}

2
web/client/src/sections/financeInvoice/components/FinanceInvoiceWorkspace.jsx

@ -87,7 +87,7 @@ const formatQueryHistoryTitle = (item) => {
const handleFinanceInvoiceAuthExpired = () => {
clearCompatibleAuthInfo();
window.location.replace("/chat");
window.location.replace("/aichat");
};
/**

23
web/client/src/sections/superAgent/container/index.jsx

@ -1534,12 +1534,6 @@ const SuperAgent = () => {
const handleStopAndCancel = async () => {
const sessionId = activeSessionId || activeTaskId;
const currentTask =
latestProgressTaskRef.current || restoredSessionTask || activeStreamTask || {};
const suspendedTask = {
...currentTask,
status: "suspended",
};
const stopOperations = [stream.stopRun()];
if (sessionId && currentUserId) {
stopOperations.push(
@ -1557,10 +1551,15 @@ const SuperAgent = () => {
return;
}
if (sessionId) {
commitProgressTask(sessionId, suspendedTask, { status: "suspended" });
} else {
setRestoredSessionTask(suspendedTask);
updateActiveTask({ status: "suspended" });
try {
await stream.refreshState();
} catch (error) {
superAgentError("container.stop", "state.refresh_failed", {
sessionId,
error,
});
message.error(error?.message || "停止后状态同步失败");
}
}
};
@ -2412,7 +2411,9 @@ const SuperAgent = () => {
const shouldHideSidebar =
isAgentRoute &&
["stable-finance-invoice", "beta-message"].includes(activeAgentApp?.key);
["stable-finance-invoice", "stable-plagiarism-check", "beta-message"].includes(
activeAgentApp?.key,
);
const sidebarProps = {
collapsed: isMobileLayout ? false : collapsed,
routeType,

10
web/client/src/sections/superAgent/container/index.less

@ -4302,8 +4302,16 @@ body.sidebar-session-dnd-active .sidebar-session-drop-slot {
.super-agent-square-view .market-app-body {
height: 100%;
min-height: 0;
overflow: auto;
overflow: hidden;
padding: 24px;
scrollbar-width: none;
-ms-overflow-style: none;
}
.super-agent-square-view .market-app-body::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
}
@media (max-width: 768px) {

9
web/client/src/sections/superAgent/hooks/useSuperAgentStream.js

@ -964,6 +964,14 @@ const useSuperAgentStream = ({
await stream.stop();
}, [stream]);
//[刷新当前 thread state][暂停后同步后端最新任务状态,避免继续使用旧的运行中快照]
const refreshState = useCallback(async () => {
const sessionId = String(activeSessionId || "").trim();
const threadId = String(eventTransport.threadId || "").trim();
if (!sessionId || sessionId !== threadId) return null;
return eventTransport.getState();
}, [activeSessionId, eventTransport]);
const currentSessionId = String(activeSessionId || "");
const currentThreadId = String(stream.threadId || "");
const projectedThreadId = String(
@ -1280,6 +1288,7 @@ const useSuperAgentStream = ({
respondInterrupt,
respondAllInterrupts: stream.respondAll,
stopRun,
refreshState,
disconnect: stream.disconnect,
prepareForSessionSwitch,
};

6
web/client/src/utils/index.js

@ -34,7 +34,7 @@ const apiRequest = new request({
if (err) {
if (err?.status === 401) {
clearCompatibleAuthInfo();
window.location.replace("/chat");
window.location.replace("/aichat");
}
return err;
}
@ -48,7 +48,7 @@ const fgptRequest = new request({
if (err) {
if (err?.status === 401) {
clearCompatibleAuthInfo();
window.location.replace("/chat");
window.location.replace("/aichat");
}
return err;
}
@ -75,7 +75,7 @@ const schemeListRequest = new request({
if (err) {
if (err?.status === 401) {
clearCompatibleAuthInfo();
window.location.replace("/chat");
window.location.replace("/aichat");
}
return err;
}

Loading…
Cancel
Save