feat: add base path to resources (#17655)

Co-authored-by: fhliu4 <fhliu4@iflytek.com>
This commit is contained in:
diuwu 2025-04-15 17:05:50 +08:00 • committed by GitHub
commit 7161d7ad96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 146 additions and 38 deletions

View file

@ -14,6 +14,7 @@ import Type from './type'
import Category from './category'
import Tools from './tools'
import cn from '@/utils/classnames'
import { basePath } from '@/utils/var'
import I18n from '@/context/i18n'
import Drawer from '@/app/components/base/drawer'
import Button from '@/app/components/base/button'
@ -57,6 +58,12 @@ const AddToolModal: FC<Props> = ({
const getAllTools = async () => {
setListLoading(true)
const buildInTools = await fetchAllBuiltInTools()
if (basePath) {
buildInTools.forEach((item) => {
if (typeof item.icon == 'string' && !item.icon.includes(basePath))
item.icon = `${basePath}${item.icon}`
})
}
const customTools = await fetchAllCustomTools()
const workflowTools = await fetchAllWorkflowTools()
const mergedToolList = [