chore: keep error message visiable on hover

This commit is contained in:
jialin
2026-02-08 19:44:43 +08:00
parent 33ce334bd7
commit 293c53d8dd
3 changed files with 9440 additions and 11606 deletions
+1 -1
View File
@@ -1 +1 @@
22.21.1
22
+9408 -11602
View File
File diff suppressed because it is too large Load Diff
@@ -1,9 +1,23 @@
import { userAtom } from '@/atoms/user';
import { clearAtomStorage } from '@/atoms/utils';
import { RequestConfig, history } from '@umijs/max';
import { message } from 'antd';
import { history, RequestConfig } from '@umijs/max';
import { message, Typography } from 'antd';
import styled from 'styled-components';
import { DEFAULT_ENTER_PAGE } from './config/settings';
const Content = styled.div`
position: relative;
.cp-btn {
position: absolute;
top: 0px;
right: -4px;
opacity: 5;
}
.msg {
display: none;
}
`;
// these APIs do not via the GPUSTACK_API_BASE_URL
const NoBaseURLAPIs = ['/auth', '/v1', '/version', '/proxy', '/update'];
@@ -24,7 +38,21 @@ export const requestConfig: RequestConfig = {
errorMessage;
if (!opts?.skipErrorHandler && response?.status) {
message.error(errMsg);
message.error({
content: (
<Content>
<Typography.Text
className="cp-btn"
copyable={{
text: errMsg
}}
>
<span className="msg">{errMsg}</span>
</Typography.Text>
{errMsg}
</Content>
)
});
}
if (response?.status === 401) {
clearAtomStorage(userAtom);