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
commit efad1e4790
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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()
}