feat: 图片地址

This commit is contained in:
archer
2023-03-06 17:20:14 +08:00
parent 9f8d696bbe
commit dd5217d8a5
18 changed files with 113 additions and 109 deletions

View File

@@ -34,12 +34,7 @@ const Navbar = ({
>
{/* logo */}
<Box pb={4}>
<Image
src={'https://docgpt-1301319986.cos.ap-shanghai.myqcloud.com/icon/logo.png'}
width={'35'}
height={'35'}
alt=""
></Image>
<Image src={'/icon/logo.png'} width={'35'} height={'35'} alt=""></Image>
</Box>
{/* 导航列表 */}
<Box flex={1}>

View File

@@ -48,13 +48,7 @@ const NavbarPhone = ({
<DrawerContent maxWidth={'50vw'}>
<DrawerBody p={4}>
<Box py={4}>
<Image
src={'https://docgpt-1301319986.cos.ap-shanghai.myqcloud.com/icon/logo.png'}
margin={'auto'}
w={'35'}
h={'35'}
alt=""
></Image>
<Image src={'/icon/logo.png'} margin={'auto'} w={'35'} h={'35'} alt=""></Image>
</Box>
{navbarList.map((item) => (
<Flex

View File

@@ -38,6 +38,5 @@ export const introPage = `
* 分享链接应为http://docgpt.ahapocket.cn/chat?chatId=6402c9f64cb5d6283f764
### 其他问题
还有其他问题,可以加我 wx拉个交流群大家一起聊聊。
![](https://docgpt-1301319986.cos.ap-shanghai.myqcloud.com/icon/erweima.jpg)
还有其他问题,可以加我 wx: YNyiqi,拉个交流群大家一起聊聊。
`;

View File

@@ -1,4 +1,4 @@
import { useState, useRef } from 'react';
import { useCallback, useRef } from 'react';
import {
AlertDialog,
AlertDialogBody,
@@ -17,45 +17,51 @@ export const useConfirm = ({ title = '提示', content }: { title?: string; cont
const cancelCb = useRef<any>();
return {
openConfirm: (confirm?: any, cancel?: any) => {
onOpen();
confirmCb.current = confirm;
cancelCb.current = cancel;
},
ConfirmChild: () => (
<AlertDialog isOpen={isOpen} leastDestructiveRef={cancelRef} onClose={onClose}>
<AlertDialogOverlay>
<AlertDialogContent>
<AlertDialogHeader fontSize="lg" fontWeight="bold">
{title}
</AlertDialogHeader>
openConfirm: useCallback(
(confirm?: any, cancel?: any) => {
onOpen();
confirmCb.current = confirm;
cancelCb.current = cancel;
},
[onOpen]
),
ConfirmChild: useCallback(
() => (
<AlertDialog isOpen={isOpen} leastDestructiveRef={cancelRef} onClose={onClose}>
<AlertDialogOverlay>
<AlertDialogContent>
<AlertDialogHeader fontSize="lg" fontWeight="bold">
{title}
</AlertDialogHeader>
<AlertDialogBody>{content}</AlertDialogBody>
<AlertDialogBody>{content}</AlertDialogBody>
<AlertDialogFooter>
<Button
colorScheme={'gray'}
onClick={() => {
onClose();
typeof cancelCb.current === 'function' && cancelCb.current();
}}
>
</Button>
<Button
colorScheme="blue"
ml={3}
onClick={() => {
onClose();
typeof confirmCb.current === 'function' && confirmCb.current();
}}
>
</Button>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialogOverlay>
</AlertDialog>
<AlertDialogFooter>
<Button
colorScheme={'gray'}
onClick={() => {
onClose();
typeof cancelCb.current === 'function' && cancelCb.current();
}}
>
</Button>
<Button
colorScheme="blue"
ml={4}
onClick={() => {
onClose();
typeof confirmCb.current === 'function' && confirmCb.current();
}}
>
</Button>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialogOverlay>
</AlertDialog>
),
[content, isOpen, onClose, title]
)
};
};

View File

@@ -1,36 +1,33 @@
import { useState, memo } from 'react';
import { useState, useCallback } from 'react';
import { Spinner, Flex } from '@chakra-ui/react';
export const useLoading = (props?: { defaultLoading: boolean }) => {
const [isLoading, setIsLoading] = useState(props?.defaultLoading || false);
const Loading = ({
loading,
fixed = true
}: {
loading?: boolean;
fixed?: boolean;
}): JSX.Element | null => {
return isLoading || loading ? (
<Flex
position={fixed ? 'fixed' : 'absolute'}
zIndex={100}
backgroundColor={'rgba(255,255,255,0.5)'}
top={0}
left={0}
right={0}
bottom={0}
alignItems={'center'}
justifyContent={'center'}
>
<Spinner thickness="4px" speed="0.65s" emptyColor="gray.200" color="blue.500" size="xl" />
</Flex>
) : null;
};
const Loading = useCallback(
({ loading, fixed = true }: { loading?: boolean; fixed?: boolean }): JSX.Element | null => {
return isLoading || loading ? (
<Flex
position={fixed ? 'fixed' : 'absolute'}
zIndex={100}
backgroundColor={'rgba(255,255,255,0.5)'}
top={0}
left={0}
right={0}
bottom={0}
alignItems={'center'}
justifyContent={'center'}
>
<Spinner thickness="4px" speed="0.65s" emptyColor="gray.200" color="blue.500" size="xl" />
</Flex>
) : null;
},
[isLoading]
);
return {
isLoading,
setIsLoading,
Loading: memo(Loading)
Loading
};
};

View File

@@ -15,18 +15,18 @@ Router.events.on('routeChangeStart', () => NProgress.start());
Router.events.on('routeChangeComplete', () => NProgress.done());
Router.events.on('routeChangeError', () => NProgress.done());
export default function App({ Component, pageProps }: AppProps) {
// Create a client
const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
retry: false,
cacheTime: 0
}
// Create a client
const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
retry: false,
cacheTime: 0
}
});
}
});
export default function App({ Component, pageProps }: AppProps) {
return (
<>
<Head>

View File

@@ -300,12 +300,8 @@ const Chat = () => {
<Flex maxW={'800px'} m={'auto'} alignItems={'flex-start'}>
<Box mr={media(4, 1)}>
<Image
src={
item.obj === 'Human'
? 'https://docgpt-1301319986.cos.ap-shanghai.myqcloud.com/icon/human.png'
: 'https://docgpt-1301319986.cos.ap-shanghai.myqcloud.com/icon/logo.png'
}
alt="https://docgpt-1301319986.cos.ap-shanghai.myqcloud.com/icon/logo.png"
src={item.obj === 'Human' ? '/icon/human.png' : '/icon/logo.png'}
alt="/icon/logo.png"
width={30}
height={30}
/>
@@ -394,7 +390,7 @@ const Chat = () => {
{isChatting ? (
<Image
style={{ transform: 'translateY(4px)' }}
src={'https://docgpt-1301319986.cos.ap-shanghai.myqcloud.com/icon/chatting.svg'}
src={'/icon/chatting.svg'}
width={30}
height={30}
alt={''}

View File

@@ -1,6 +1,5 @@
.loginPage {
background: url('https://docgpt-1301319986.cos.ap-shanghai.myqcloud.com/icon/login-bg.svg')
no-repeat;
background: url('/icon/login-bg.svg') no-repeat;
background-size: cover;
user-select: none;
}

View File

@@ -53,7 +53,7 @@ const Login = () => {
>
{isPc && (
<Image
src={'https://docgpt-1301319986.cos.ap-shanghai.myqcloud.com/icon/loginLeft.svg'}
src={'/icon/loginLeft.svg'}
order={pageType === PageTypeEnum.login ? 0 : 2}
flex={'1 0 0'}
w="0"