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

Co-authored-by: qingguo <qingguo@lexin.com>
This commit is contained in:
GQ1994
2025-05-27 14:04:22 +08:00
committed by GitHub
parent 9c9d3d7bd0
commit efad1e4790
2 changed files with 2 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ export default function RoutePrefixHandle() {
const addPrefixToImg = (e: HTMLImageElement) => {
const url = new URL(e.src)
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
e.src = url.toString()
}