智能会话和知识库

main
jiangxucong 3 months ago
parent a4d9f072e3
commit 501830f424

@ -231,7 +231,7 @@
"y-webrtc": "^10.3.0", "y-webrtc": "^10.3.0",
"yaml": "^2.5.0", "yaml": "^2.5.0",
"yjs": "^13.6.18", "yjs": "^13.6.18",
"zod": "^3.23.8", "zod": "^3.24.1",
"zustand": "^4.5.5", "zustand": "^4.5.5",
"zustand-utils": "^1.3.2" "zustand-utils": "^1.3.2"
}, },
@ -246,6 +246,7 @@
"@peculiar/webcrypto": "^1.5.0", "@peculiar/webcrypto": "^1.5.0",
"@testing-library/jest-dom": "^6.4.8", "@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^16.0.0", "@testing-library/react": "^16.0.0",
"@types/axios": "^0.14.4",
"@types/chroma-js": "^2.4.4", "@types/chroma-js": "^2.4.4",
"@types/debug": "^4.1.12", "@types/debug": "^4.1.12",
"@types/diff": "^5.2.1", "@types/diff": "^5.2.1",

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

@ -38,7 +38,7 @@ export interface TopActionProps {
tab?: SidebarTabKey; tab?: SidebarTabKey;
} }
const getUserId = (s:object) => s.user?.id const getUserId = (s: { user?: { id?: any } }) => s.user?.id;
const TopActions = memo<TopActionProps>(() => { const TopActions = memo<TopActionProps>(() => {
const { t } = useTranslation('common'); const { t } = useTranslation('common');
const switchBackToChat = useGlobalStore((s) => s.switchBackToChat); const switchBackToChat = useGlobalStore((s) => s.switchBackToChat);
@ -76,7 +76,7 @@ const TopActions = memo<TopActionProps>(() => {
</Link> </Link>
)} )}
{showMarket && ( {showMarket && (
<Link aria-label={t('tab.Model')} className={value === '/model' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={`/discover/models`} onClick={() => {setValue("/model"); window.localStorage.setItem("nowChat", "")}}> <Link aria-label={t('tab.model')} className={value === '/model' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={`/discover/models`} onClick={() => {setValue("/model"); window.localStorage.setItem("nowChat", "")}}>
<Image alt={"model"} className={cx(styles.iconImg)} preview={false} src="/images/mx.png" /> <Image alt={"model"} className={cx(styles.iconImg)} preview={false} src="/images/mx.png" />
<div className={value === '/model' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div> <div className={value === '/model' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
</Link> </Link>
@ -88,13 +88,13 @@ const TopActions = memo<TopActionProps>(() => {
</Link> </Link>
)} )}
{showMarket && ( {showMarket && (
<Link aria-label={t('tab.Plugins')} className={value === '/plugins' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={`/discover/plugins`} onClick={() => {setValue("/plugins"); window.localStorage.setItem("nowChat", "")}}> <Link aria-label={t('tab.plugins')} className={value === '/plugins' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={`/discover/plugins`} onClick={() => {setValue("/plugins"); window.localStorage.setItem("nowChat", "")}}>
<Image alt={"plugins"} className={cx(styles.iconImg)} preview={false} src="/images/cj.png" /> <Image alt={"plugins"} className={cx(styles.iconImg)} preview={false} src="/images/cj.png" />
<div className={value === '/plugins' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div> <div className={value === '/plugins' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
</Link> </Link>
)} )}
{showMarket && ( {showMarket && (
<Link aria-label={t('tab.Power')} className={value === '/power' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={'/power'} onClick={() => {setValue("/power"); window.localStorage.setItem("nowChat", "")}}> <Link aria-label={t('tab.power')} className={value === '/power' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={'/power'} onClick={() => {setValue("/power"); window.localStorage.setItem("nowChat", "")}}>
<Image alt={"power"} className={cx(styles.iconImg)} preview={false} src="/images/sl.png" /> <Image alt={"power"} className={cx(styles.iconImg)} preview={false} src="/images/sl.png" />
<div className={value === '/power' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div> <div className={value === '/power' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
</Link> </Link>

@ -11,7 +11,7 @@ import { UserOutlined } from '@ant-design/icons';
import { LayoutProps } from './type'; import { LayoutProps } from './type';
import { Divider, Avatar } from "antd"; import { Divider, Avatar } from "antd";
const title = { const title:{[key: string]: string } = {
"/chat": '会话', "/chat": '会话',
"/discover/assistants": "助手", "/discover/assistants": "助手",
"/files": "工具", "/files": "工具",

@ -528,6 +528,7 @@ const stList = [
{ {
date: '2024-02-03', date: '2024-02-03',
des: "擅长产品功能分析与用户价值观广告文案创作。", des: "擅长产品功能分析与用户价值观广告文案创作。",
id: '1',
title: 'XXX助手', title: 'XXX助手',
}, },
] ]
@ -703,17 +704,17 @@ const useStyles = createStyles(({css}) => ({
})) }))
const getContainer = () => document.querySelector("#fileRight") const getContainer = () => document.querySelector("#fileRight")
const handleClickCard = (e) => { const handleClickCard = (e: { website?: any }) => {
window.open(e.website, '_blank'); window.open(e.website, '_blank');
} }
const onClickAncho = (e,link) => { const onClickAncho = (e: { preventDefault?: any },link: { href?: any }) => {
e.preventDefault() e.preventDefault()
let srcolls = document.querySelector(link.href) let srcolls = document.querySelector(link.href)
srcolls.scrollIntoView({ // srcolls.scrollIntoView({
behavior: 'smooth', // behavior: 'smooth',
block: 'start' // block: 'start'
}) // })
} }
const ApplicationSet = memo(() => { const ApplicationSet = memo(() => {
const { styles, cx } = useStyles() const { styles, cx } = useStyles()
@ -725,7 +726,7 @@ const ApplicationSet = memo(() => {
request({ request({
method: "get", method: "get",
url: "/flxai/api/robot/apptoolsset/getAllAiTools", url: "/flxai/api/robot/apptoolsset/getAllAiTools",
}).then(response => { }).then((response:{ code?: any,data?: any }) => {
if (response.code === 0) { if (response.code === 0) {
console.log(response,"2222") console.log(response,"2222")
setStData(response.data); setStData(response.data);
@ -737,11 +738,11 @@ const ApplicationSet = memo(() => {
fetchData(); fetchData();
}, []); // 空数组[]意味着仅在组件挂载时调用一次 }, []); // 空数组[]意味着仅在组件挂载时调用一次
const handleClick = (e) => { const handleClick = (e: string) => {
setVal(e) setVal(e)
} }
const onChangeAnchor = (e) => { const onChangeAnchor = (e: string) => {
setAchVal(e) setAchVal(e)
} }
@ -752,7 +753,8 @@ const ApplicationSet = memo(() => {
<Button className={cx(styles.btn, val==='tj'&&styles.selectBtn)} onClick={() => handleClick("tj")}></Button> <Button className={cx(styles.btn, val==='tj'&&styles.selectBtn)} onClick={() => handleClick("tj")}></Button>
</div> </div>
<div style={{ display: 'flex', overflowY: 'scroll' }}> <div style={{ display: 'flex', overflowY: 'scroll' }}>
{val === 'AI' ? <> {val === 'AI' ?
<>
<Anchor <Anchor
affix={false} affix={false}
getContainer={getContainer} getContainer={getContainer}
@ -1087,7 +1089,7 @@ const ApplicationSet = memo(() => {
</div> </div>
<div className={styles.cardCotain}> <div className={styles.cardCotain}>
<div> <div>
<Image alt="" clasName={styles.desImg} preview={false} src="/images/detaicon.png" /> <Image alt="" className={styles.desImg} preview={false} src="/images/detaicon.png" />
<span className={styles.zsds}></span> <span className={styles.zsds}></span>
<span>{e.date}</span> <span>{e.date}</span>
</div> </div>

@ -2,7 +2,7 @@ import { createStyles } from 'antd-style';
import { imageUrl } from '@/const/url'; import { imageUrl } from '@/const/url';
export const useStyles = createStyles(({ css, token, stylish, cx }, withBackground: boolean) => ({ export const useStyles = createStyles(({ css, token, cx }, withBackground: boolean) => ({
background: css` background: css`
padding: 24px; padding: 24px;
@ -34,7 +34,7 @@ export const useStyles = createStyles(({ css, token, stylish, cx }, withBackgrou
border-block-end: 1px solid ${token.colorBorder}; border-block-end: 1px solid ${token.colorBorder};
`, `,
preview: cx( preview: cx(
stylish.noScrollbar, // stylish.noScrollbar,
css` css`
overflow: hidden scroll; overflow: hidden scroll;

@ -46,7 +46,7 @@ const ShareText = memo(() => {
const data = [ const data = [
["question", "answer"], ["question", "answer"],
]; ];
let arrItem = []; let arrItem:string[] = [];
messagesNew.forEach((chat)=> { messagesNew.forEach((chat)=> {
if (chat.role === 'assistant') { if (chat.role === 'assistant') {
arrItem.push(chat.content) arrItem.push(chat.content)

@ -72,7 +72,7 @@ interface HeaderProps {
identifier: string; identifier: string;
mobile?: boolean; mobile?: boolean;
} }
const getUserId = (s) => s.user?.id const getUserId = (s: { user?: { id?: any } }) => s.user?.id;
const Header = memo<HeaderProps>(({ identifier, data, mobile }) => { const Header = memo<HeaderProps>(({ identifier, data, mobile }) => {
const { styles, theme } = useStyles(); const { styles, theme } = useStyles();
const router = useRouter() const router = useRouter()

@ -70,7 +70,7 @@ interface HeaderProps {
mobile?: boolean; mobile?: boolean;
} }
const getUserId = (s) => s.user?.id const getUserId = (s: { user?: { id?: any } }) => s.user?.id;
const Header = memo<HeaderProps>(({ identifier, data, mobile }) => { const Header = memo<HeaderProps>(({ identifier, data, mobile }) => {
const { styles, theme } = useStyles(); const { styles, theme } = useStyles();

@ -67,7 +67,7 @@ interface HeaderProps {
identifier: string; identifier: string;
mobile?: boolean; mobile?: boolean;
} }
const getUserId = (s) => s.user?.id const getUserId = (s: { user?: { id?: any } }) => s.user?.id;
const Header = memo<HeaderProps>(({ identifier, data, mobile }) => { const Header = memo<HeaderProps>(({ identifier, data, mobile }) => {
const { styles, theme } = useStyles(); const { styles, theme } = useStyles();

@ -3,7 +3,7 @@ import Link from 'next/link';
import { memo } from 'react'; import { memo } from 'react';
import urlJoin from 'url-join'; import urlJoin from 'url-join';
import { DiscoverModelItem } from '@/typesgpt-4o-mini'; import { DiscoverModelItem } from '@/types/discover';
import Card from '../../models/features/Card'; import Card from '../../models/features/Card';

@ -30,9 +30,9 @@ const Page = async ({ params, searchParams }: Props) => {
const { t: td } = await translation('discover', searchParams?.hl); const { t: td } = await translation('discover', searchParams?.hl);
const mobile = isMobileDevice(); const mobile = isMobileDevice();
const discoverService = new DiscoverService(); const discoverService = new DiscoverService();
console.log(params.slug,"3333333") // console.log(params.slug,"3333333")
const items = await discoverService.getAssistantCategory(locale, params.slug); const items = await discoverService.getAssistantCategory(locale, params.slug);
console.log("8272772727",items) // console.log("8272772727",items)
const ld = ldModule.generate({ const ld = ldModule.generate({
description: t('discover.assistants.description'), description: t('discover.assistants.description'),
title: [td(`category.assistant.${params.slug}`), t('discover.assistants.title')].join(' · '), title: [td(`category.assistant.${params.slug}`), t('discover.assistants.title')].join(' · '),

@ -78,7 +78,7 @@ export interface AssistantCardProps
variant?: 'default' | 'compact'; variant?: 'default' | 'compact';
} }
const getUserId = (s) => s.user?.id const getUserId = (s: { user?: { id?: any } }) => s.user?.id
const AssistantCard = memo<AssistantCardProps>( const AssistantCard = memo<AssistantCardProps>(
({ showCategory, className, meta, createdAt, author, variant, ...rest }) => { ({ showCategory, className, meta, createdAt, author, variant, ...rest }) => {
@ -91,7 +91,7 @@ const AssistantCard = memo<AssistantCardProps>(
const isCompact = variant === 'compact'; const isCompact = variant === 'compact';
const userId = getUserId(useUserStore.getState()) const userId = getUserId(useUserStore.getState())
// console.log(tags,avatar,author,9383737) // console.log(tags,avatar,author,9383737)
console.log(userId,"9999999999") // console.log(userId,"9999999999")
const [val, setVal] = useState('') const [val, setVal] = useState('')
const handleCollect = (e) => { const handleCollect = (e) => {
console.log(e,"8844848") console.log(e,"8844848")
@ -116,7 +116,7 @@ const AssistantCard = memo<AssistantCardProps>(
method: "post", method: "post",
url: "/flxai/api/robot/appaiassistant", url: "/flxai/api/robot/appaiassistant",
}).then(response => { }).then(response => {
console.log(response,"222222222") // console.log(response,"222222222")
if (response.code === 0) { if (response.code === 0) {
message.success(t('collectSuccess')); message.success(t('collectSuccess'));
setVal("1") setVal("1")

@ -22,7 +22,7 @@ export interface ListProps {
mobile?: boolean; mobile?: boolean;
searchKeywords?: string; searchKeywords?: string;
} }
const getUserId = (s) => s.user?.id const getUserId = (s: { user?: { id?: any } }) => s.user?.id
const List = memo<ListProps>(({ category, mobile, searchKeywords, items = [] }) => { const List = memo<ListProps>(({ category, mobile, searchKeywords, items = [] }) => {
const { t } = useTranslation('discover'); const { t } = useTranslation('discover');
@ -30,8 +30,8 @@ const List = memo<ListProps>(({ category, mobile, searchKeywords, items = [] })
const [stData, setStData] = useState(items) const [stData, setStData] = useState(items)
const recentLength = mobile ? 4 : 8; const recentLength = mobile ? 4 : 8;
const userId = getUserId(useUserStore.getState()) const userId = getUserId(useUserStore.getState())
console.log(userId,'zhushou---3837373266262266') // console.log(userId,'zhushou---3837373266262266')
console.log('zhushou--------------',items) // console.log('zhushou--------------',items)
const { all, recent, last } = useMemo(() => { const { all, recent, last } = useMemo(() => {
return { return {
all: stData, all: stData,
@ -65,7 +65,7 @@ const List = memo<ListProps>(({ category, mobile, searchKeywords, items = [] })
res?.data?.forEach((item) => { res?.data?.forEach((item) => {
array2Object[item.identifier] = item; array2Object[item.identifier] = item;
}); });
console.log('chajian22222222222222222222222222222--------------') // console.log('chajian22222222222222222222222222222--------------')
setStData(stData.map((item)=> { setStData(stData.map((item)=> {
const matchingItem = array2Object[item.identifier]; const matchingItem = array2Object[item.identifier];
if (matchingItem) { if (matchingItem) {
@ -80,7 +80,7 @@ const List = memo<ListProps>(({ category, mobile, searchKeywords, items = [] })
}; };
fetchData(); fetchData();
}, []); // 空数组[]意味着仅在组件挂载时调用一次 }, []); // 空数组[]意味着仅在组件挂载时调用一次
console.log(category,recent,last,"92929292") // console.log(category,recent,last,"92929292")
const handleClickCard = (item) => { const handleClickCard = (item) => {
console.log(item) console.log(item)
router.push(urlJoin('/discover/assistant/', item.identifier)) router.push(urlJoin('/discover/assistant/', item.identifier))

@ -36,7 +36,7 @@ const Page = async ({ params, searchParams }: Props) => {
const discoverService = new DiscoverService(); const discoverService = new DiscoverService();
const list = await discoverService.getProviderList(locale); const list = await discoverService.getProviderList(locale);
const cate = list.find((cate) => cate.identifier === params.slug); const cate = list.find((cate) => cate.identifier === params.slug);
console.log(params.slug,"3333333") // console.log(params.slug,"3333333")
const items = await discoverService.getModelCategory(locale, params.slug); const items = await discoverService.getModelCategory(locale, params.slug);
const ld = ldModule.generate({ const ld = ldModule.generate({
description: t('discover.models.description'), description: t('discover.models.description'),

@ -80,7 +80,7 @@ const useStyles = createStyles(({ css, token, isDarkMode }) => ({
export interface ModelCardProps extends DiscoverModelItem, FlexboxProps { export interface ModelCardProps extends DiscoverModelItem, FlexboxProps {
showCategory?: boolean; showCategory?: boolean;
} }
const getUserId = (s) => s.user?.id const getUserId = (s: { user?: { id?: any } }) => s.user?.id
const ModelCard = memo<ModelCardProps>(({ className, meta, socialData, identifier, ...rest }) => { const ModelCard = memo<ModelCardProps>(({ className, meta, socialData, identifier, ...rest }) => {
const { title, description, functionCall, vision, tokens, category, id, displayName, enabled } = meta; const { title, description, functionCall, vision, tokens, category, id, displayName, enabled } = meta;
const { conversations, likes, tokens: socialDataToken } = socialData; const { conversations, likes, tokens: socialDataToken } = socialData;
@ -93,7 +93,7 @@ const ModelCard = memo<ModelCardProps>(({ className, meta, socialData, identifie
const userId = getUserId(useUserStore.getState()) const userId = getUserId(useUserStore.getState())
const [val, setVal] = useState(status) const [val, setVal] = useState(status)
const handleCollect = (e) => { const handleCollect = (e) => {
console.log(e,"8844848") // console.log(e,"8844848")
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
const params = { const params = {
@ -118,7 +118,7 @@ const ModelCard = memo<ModelCardProps>(({ className, meta, socialData, identifie
method: "post", method: "post",
url: "/flxai/api/robot/appaimodel", url: "/flxai/api/robot/appaimodel",
}).then(response => { }).then(response => {
console.log(response,"222222222") // console.log(response,"222222222")
if (response.code === 0) { if (response.code === 0) {
message.success(d('collectSuccess')); message.success(d('collectSuccess'));
setVal("1") setVal("1")

@ -2,7 +2,7 @@
import { Empty } from 'antd'; import { Empty } from 'antd';
// import Link from 'next/link'; // import Link from 'next/link';
import { memo, useState } from 'react'; import { memo, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import urlJoin from 'url-join'; import urlJoin from 'url-join';
import { useRouter } from 'next/navigation'; import { useRouter } from 'next/navigation';
@ -21,14 +21,16 @@ export interface ListProps {
mobile?: boolean; mobile?: boolean;
searchKeywords?: string; searchKeywords?: string;
} }
const getUserId = (s) => s.user?.id const getUserId = (s: { user?: { id?: any } }) => s.user?.id
const List = memo<ListProps>(async ({ category, searchKeywords, items = [] }) => { const List = memo<ListProps>(async ({ category, searchKeywords, items = [] }) => {
const { t } = useTranslation('discover'); const { t } = useTranslation('discover');
const router = useRouter() const router = useRouter()
const userId = getUserId(useUserStore.getState()) const userId = getUserId(useUserStore.getState())
const [stData, setStData] = useState(items) const [stData, setStData] = useState(items)
console.log(userId,'models---3837373266262266') // console.log(userId,'models---3837373266262266')
console.log('models---99999999',items) // console.log('models---99999999',items)
useEffect(() => {
const fetchData = async() => {
if(category === "collect") { if(category === "collect") {
const res = await request({ const res = await request({
method: "get", method: "get",
@ -69,6 +71,10 @@ const List = memo<ListProps>(async ({ category, searchKeywords, items = [] }) =>
} }
})) }))
} }
};
fetchData();
}, []); // 空数组[]意味着仅在组件挂载时调用一次
const handleClickCard = (item) => { const handleClickCard = (item) => {
console.log(item) console.log(item)
router.push(urlJoin('/discover/model/', item.identifier)) router.push(urlJoin('/discover/model/', item.identifier))

@ -28,7 +28,7 @@ const Page = async ({ searchParams }: Props) => {
const mobile = isMobileDevice(); const mobile = isMobileDevice();
const discoverService = new DiscoverService(); const discoverService = new DiscoverService();
const items = await discoverService.getModelList(locale); const items = await discoverService.getModelList(locale);
console.log("8272772727",'jiangxucong') // console.log("8272772727",'jiangxucong')
const ld = ldModule.generate({ const ld = ldModule.generate({
description: t('discover.models.description'), description: t('discover.models.description'),

@ -80,7 +80,7 @@ interface PluginCardProps
showCategory?: boolean; showCategory?: boolean;
variant?: 'default' | 'compact'; variant?: 'default' | 'compact';
} }
const getUserId = (s) => s.user?.id const getUserId = (s: { user?: { id?: any } }) => s.user?.id
const PluginCard = memo<PluginCardProps>( const PluginCard = memo<PluginCardProps>(
({ className, showCategory, meta, createdAt, author, variant, ...rest }) => { ({ className, showCategory, meta, createdAt, author, variant, ...rest }) => {
const { avatar, title, description, tags = [], category } = meta; const { avatar, title, description, tags = [], category } = meta;
@ -91,11 +91,11 @@ const PluginCard = memo<PluginCardProps>(
const { message } = App.useApp(); const { message } = App.useApp();
const isCompact = variant === 'compact'; const isCompact = variant === 'compact';
const userId = getUserId(useUserStore.getState()) const userId = getUserId(useUserStore.getState())
console.log(status,"9383737-------------------------------------") // console.log(status,"9383737-------------------------------------")
console.log(manifest,locale,"plugins9999999999-------------------") // console.log(manifest,locale,"plugins9999999999-------------------")
const [val, setVal] = useState('') const [val, setVal] = useState('')
const handleCollect = (e) => { const handleCollect = (e) => {
console.log(e,"8844848") // console.log(e,"8844848")
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
const params = { const params = {
@ -118,7 +118,7 @@ const PluginCard = memo<PluginCardProps>(
method: "post", method: "post",
url: "/flxai/api/robot/appaiplugin", url: "/flxai/api/robot/appaiplugin",
}).then(response => { }).then(response => {
console.log(response,"222222222") // console.log(response,"222222222")
if (response.code === 0) { if (response.code === 0) {
message.success(t('collectSuccess')); message.success(t('collectSuccess'));
setVal("1") setVal("1")
@ -128,9 +128,9 @@ const PluginCard = memo<PluginCardProps>(
}) })
} }
const renderElement = () => { const renderElement = () => {
console.log(classify,'66666----------------------') // console.log(classify,'66666----------------------')
if (classify !== 'collect') { if (classify !== 'collect') {
console.log(status,"222222222--------------------------") // console.log(status,"222222222--------------------------")
if(status === "1" || val === "1") { if(status === "1" || val === "1") {
return <div className={styles.collectBtn} onClick={(e) => {e.stopPropagation()}}><StarOutlined style={{color: '#FFAD01'}}/></div> return <div className={styles.collectBtn} onClick={(e) => {e.stopPropagation()}}><StarOutlined style={{color: '#FFAD01'}}/></div>
} else { } else {

@ -22,15 +22,15 @@ export interface ListProps {
mobile?: boolean; mobile?: boolean;
searchKeywords?: string; searchKeywords?: string;
} }
const getUserId = (s) => s.user?.id const getUserId = (s: { user?: { id?: any } }) => s.user?.id
const List = memo<ListProps>(({ category, mobile, searchKeywords, items = [] }) => { const List = memo<ListProps>(({ category, mobile, searchKeywords, items = [] }) => {
const { t } = useTranslation('discover'); const { t } = useTranslation('discover');
const router = useRouter() const router = useRouter()
const [stData, setStData] = useState(items) const [stData, setStData] = useState(items)
const recentLength = mobile ? 4 : 8; const recentLength = mobile ? 4 : 8;
const userId = getUserId(useUserStore.getState()) const userId = getUserId(useUserStore.getState())
console.log(userId,'chajian---3837373266262266') // console.log(userId,'chajian---3837373266262266')
console.log('chajian33333333--------------',items) // console.log('chajian33333333--------------',items)
const { all, recent, last } = useMemo(() => { const { all, recent, last } = useMemo(() => {
return { return {
all: stData, all: stData,
@ -64,7 +64,7 @@ const List = memo<ListProps>(({ category, mobile, searchKeywords, items = [] })
res?.data?.forEach((item) => { res?.data?.forEach((item) => {
array2Object[item.identifier] = item; array2Object[item.identifier] = item;
}); });
console.log('chajian22222222222222222222222222222--------------') // console.log('chajian22222222222222222222222222222--------------')
setStData(stData.map((item)=> { setStData(stData.map((item)=> {
const matchingItem = array2Object[item.identifier]; const matchingItem = array2Object[item.identifier];
if (matchingItem) { if (matchingItem) {
@ -80,7 +80,7 @@ const List = memo<ListProps>(({ category, mobile, searchKeywords, items = [] })
fetchData(); fetchData();
}, []); // 空数组[]意味着仅在组件挂载时调用一次 }, []); // 空数组[]意味着仅在组件挂载时调用一次
console.log('chajian999999999999999--------------',stData) // console.log('chajian999999999999999--------------',stData)
const handleClickCard = (item) => { const handleClickCard = (item) => {
console.log(item) console.log(item)

@ -498,13 +498,14 @@ const RobotList = memo<{ mobile?: boolean }>(() => {
return ( return (
<> <>
<div style={{display: value === 1 ? 'block': 'none'}}> <div style={{display: value === 1 ? 'block': 'none',height: '100%'}}>
<div style={{ fontSize: '20px', height: '70px', lineHeight: '70px', marginLeft: '60px' }}> <div style={{ fontSize: '20px', height: '70px', lineHeight: '70px', marginLeft: '60px' }}>
<Button className={styles.buttonStyle} onClick={()=>handleSwitch(2)} shape="round" size="small" style={{marginLeft: '24px'}} type="link" variant="solid"> <Button className={styles.buttonStyle} onClick={()=>handleSwitch(2)} shape="round" size="small" style={{marginLeft: '24px'}} type="link" variant="solid">
</Button> </Button>
</div> </div>
<div style={{height: '100%'}}>
<List <List
dataSource={data} dataSource={data}
grid={{ grid={{
@ -543,6 +544,7 @@ const RobotList = memo<{ mobile?: boolean }>(() => {
style={{marginTop: '10px', padding: '0 50px'}} style={{marginTop: '10px', padding: '0 50px'}}
/> />
</div> </div>
</div>
<div style={{display: value === 2 ? 'block': 'none',height: '100%'}}> <div style={{display: value === 2 ? 'block': 'none',height: '100%'}}>
<Flex justify='space-between' style={{margin: '15px 0'}} > <Flex justify='space-between' style={{margin: '15px 0'}} >
<div style={{ fontSize: '20px',lineHeight: '42px',marginLeft: '60px' }}> <div style={{ fontSize: '20px',lineHeight: '42px',marginLeft: '60px' }}>

@ -3,28 +3,21 @@
import { Icon } from '@lobehub/ui'; import { Icon } from '@lobehub/ui';
import { Button } from 'antd'; import { Button } from 'antd';
import { SendHorizonal } from 'lucide-react'; import { SendHorizonal } from 'lucide-react';
import Link from 'next/link'; // import Link from 'next/link';
import { useRouter } from 'next/navigation'; import { useRouter } from 'next/navigation';
import { memo } from 'react'; import { memo } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit'; import { Flexbox } from 'react-layout-kit';
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig'; // import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
const Actions = memo<{ mobile?: boolean }>(({ mobile }) => { const Actions = memo<{ mobile?: boolean }>(({ mobile }) => {
const { t } = useTranslation('welcome'); const { t } = useTranslation('welcome');
const router = useRouter(); const router = useRouter();
const { showMarket } = useServerConfigStore(featureFlagsSelectors); // const { showMarket } = useServerConfigStore(featureFlagsSelectors);
return ( return (
<Flexbox gap={16} horizontal={!mobile} justify={'center'} width={'100%'} wrap={'wrap'}> <Flexbox gap={16} horizontal={!mobile} justify={'center'} width={'100%'} wrap={'wrap'}>
{showMarket && (
<Link href={'/discover'}>
<Button block={mobile} size={'large'} style={{ minWidth: 160 }} type={'default'}>
{t('button.market')}
</Button>
</Link>
)}
<Button <Button
block={mobile} block={mobile}
onClick={() => router.push('/chat')} onClick={() => router.push('/chat')}

@ -1,9 +1,10 @@
import axios from 'axios'; import axios from 'axios';
// 创建axios实例
// 创建一个Axios实例并配置基础URL和请求超时时间
const service = axios.create({ const service = axios.create({
baseURL: 'http://192.168.7.3:18080', // 设置基础URL baseURL: 'http://192.168.7.3:18080', // 设置基础URL
timeout: '60000' ,// 设置请求超时时间 timeout: 60000, // 设置请求超时时间(单位为毫秒)
// withCredentials: true, // withCredentials: true, // 如果需要发送跨域请求时携带凭证如Cookies可以取消注释此行
}); });
// service.defaults.withCredentials = true; // service.defaults.withCredentials = true;
// 请求拦截器 // 请求拦截器

@ -21,6 +21,7 @@ const CustomTextLogo = memo<FlexboxProps & { size: number }>(({ size, style, ...
<Flexbox <Flexbox
height={size} height={size}
style={{ style={{
color: '#ffffff',
fontSize: size / 1.5, fontSize: size / 1.5,
fontWeight: 'bolder', fontWeight: 'bolder',
userSelect: 'none', userSelect: 'none',

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 KiB

@ -0,0 +1,5 @@
.bg {
background: url('./bg1.jpg') no-repeat center center;
background-size: 100% 100%;
position: relative;
}

@ -2,15 +2,15 @@ import { Icon } from '@lobehub/ui';
import { Loader2 } from 'lucide-react'; import { Loader2 } from 'lucide-react';
import { memo } from 'react'; import { memo } from 'react';
import { Center, Flexbox } from 'react-layout-kit'; import { Center, Flexbox } from 'react-layout-kit';
import './index.css';
import { ProductLogo } from '@/components/Branding'; import { ProductLogo } from '@/components/Branding';
const FullscreenLoading = memo<{ title?: string }>(({ title }) => { const FullscreenLoading = memo<{ title?: string }>(({ title }) => {
return ( return (
<Flexbox height={'100%'} style={{ position: 'relative', userSelect: 'none' }} width={'100%'}> <Flexbox className="bg" height={'100%'} style={{ position: 'relative', userSelect: 'none' }} width={'100%'}>
<Center flex={1} gap={16} width={'100%'}> <Center flex={1} gap={16} width={'100%'}>
<ProductLogo size={48} type={'combine'} /> <ProductLogo size={48} type={'combine'} />
<Center gap={12} horizontal style={{ fontSize: 15, lineHeight: 1.5, opacity: 0.66 }}> <Center gap={12} horizontal style={{ color: '#ffffff', fontSize: 15, lineHeight: 1.5, opacity: 0.66 }}>
<Icon icon={Loader2} size={{ fontSize: 16 }} spin /> <Icon icon={Loader2} size={{ fontSize: 16 }} spin />
{title} {title}
</Center> </Center>

@ -4,7 +4,7 @@
export const LOBE_CHAT_CLOUD = 'LobeChat Cloud'; export const LOBE_CHAT_CLOUD = 'LobeChat Cloud';
export const BRANDING_NAME = 'LobeChat'; export const BRANDING_NAME = '集智AI';
export const BRANDING_LOGO_URL = ''; export const BRANDING_LOGO_URL = '/images/logo-3d.webp';
export const ORG_NAME = 'LobeHub'; export const ORG_NAME = 'LobeHub';

@ -31,12 +31,12 @@ export const getLeftActionList: getActionList = (mobile) =>
[ [
'model', 'model',
'fileUpload', 'fileUpload',
// 'knowledgeBase', 'knowledgeBase',
// 'temperature', 'temperature',
// 'history', 'history',
!mobile && 'stt', !mobile && 'stt',
'tools', 'tools',
// 'token', 'token',
].filter(Boolean) as ActionKeys[]; ].filter(Boolean) as ActionKeys[];
export const getRightActionList: getActionList = () => ['clear'].filter(Boolean) as ActionKeys[]; export const getRightActionList: getActionList = () => ['clear'].filter(Boolean) as ActionKeys[];

@ -190,7 +190,11 @@ export default {
chat: '会话', chat: '会话',
discover: '发现', discover: '发现',
files: '文件', files: '文件',
knowledge: '知识库',
me: '我', me: '我',
model: '模型',
plugins: '插件',
power: '算力',
robot: '数字人', robot: '数字人',
setting: '设置', setting: '设置',
}, },

Loading…
Cancel
Save