浏览代码

Modifying the preview of the uploaded avatar will freeze, fix the bug… (#20202)

Co-authored-by: qingguo <qingguo@lexin.com>
tags/1.4.1
GQ1994 5 个月前
父节点
当前提交
efad1e4790
没有帐户链接到提交者的电子邮件

+ 1
- 2
web/app/components/header/account-setting/model-provider-page/provider-icon/index.tsx 查看文件

import type { FC } from 'react' import type { FC } from 'react'
import type { ModelProvider } from '../declarations' import type { ModelProvider } from '../declarations'
import { basePath } from '@/utils/var'
import { useLanguage } from '../hooks' import { useLanguage } from '../hooks'
import { Openai } from '@/app/components/base/icons/src/vender/other' import { Openai } from '@/app/components/base/icons/src/vender/other'
import { AnthropicDark, AnthropicLight } from '@/app/components/base/icons/src/public/llm' import { AnthropicDark, AnthropicLight } from '@/app/components/base/icons/src/public/llm'
<div className={cn('inline-flex items-center gap-2', className)}> <div className={cn('inline-flex items-center gap-2', className)}>
<img <img
alt='provider-icon' alt='provider-icon'
src={basePath + renderI18nObject(provider.icon_small, language)}
src={renderI18nObject(provider.icon_small, language)}
className='h-6 w-6' className='h-6 w-6'
/> />
<div className='system-md-semibold text-text-primary'> <div className='system-md-semibold text-text-primary'>

+ 1
- 1
web/app/routePrefixHandle.tsx 查看文件

const addPrefixToImg = (e: HTMLImageElement) => { const addPrefixToImg = (e: HTMLImageElement) => {
const url = new URL(e.src) const url = new URL(e.src)
const prefix = url.pathname.substr(0, basePath.length) const prefix = url.pathname.substr(0, basePath.length)
if (prefix !== basePath) {
if (prefix !== basePath && !url.href.startsWith('blob:') && !url.href.startsWith('data:')) {
url.pathname = basePath + url.pathname url.pathname = basePath + url.pathname
e.src = url.toString() e.src = url.toString()
} }

正在加载...
取消
保存