File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,8 +49,14 @@ const NodeInfoLogger = (function() {
4949 let imageUrl ;
5050 let headers = { } ;
5151
52- if ( isServerMode ) {
53- // 服务器模式,改为请求后端转发接口
52+ // 检查 filename 是否是完整的 URL(以 http:// 或 https:// 开头)
53+ const isFullUrl = filename . startsWith ( 'http://' ) || filename . startsWith ( 'https://' ) ||
54+ filename . startsWith ( 'http:/' ) || filename . startsWith ( 'https:/' ) ;
55+
56+ if ( isFullUrl ) {
57+ imageUrl = filename . replace ( / ^ ( h t t p s ? ) : \/ (? ! \/ ) / , '$1://' ) ;
58+ } else if ( isServerMode ) {
59+ // 服务器模式且非完整URL,使用后端转发接口
5460 imageUrl = `/bizyair/proxy_view?filename=${ encodeURIComponent ( filename ) } ` ;
5561 } else {
5662 // 本地模式,使用原有 buildImageUrl
@@ -128,8 +134,15 @@ const NodeInfoLogger = (function() {
128134 filename = widgetsValues [ 0 ] ;
129135 }
130136 const path = `/${ type } /${ filename } ` ;
131- let url ;
132- if ( isServerMode ) {
137+ let url ;
138+ // 检查 filename 是否是完整的 URL
139+ const isFullUrl = filename . startsWith ( 'http://' ) || filename . startsWith ( 'https://' ) ||
140+ filename . startsWith ( 'http:/' ) || filename . startsWith ( 'https:/' ) ;
141+
142+ if ( isFullUrl ) {
143+ url = filename . replace ( / ^ ( h t t p s ? ) : \/ (? ! \/ ) / , '$1://' ) ;
144+ } else if ( isServerMode ) {
145+ // 服务器模式且非完整URL,使用 /view 接口
133146 url = `/view?filename=${ encodeURIComponent ( filename ) } ` ;
134147 } else {
135148 if ( filename . startsWith ( 'data:' ) ) {
Original file line number Diff line number Diff line change 1- 1.2.60
1+ 1.2.61
You can’t perform that action at this time.
0 commit comments