|
|
@@ -1380,12 +1380,13 @@ const processIframeLinks = async () => {
|
|
|
// 解析URL,处理hash部分
|
|
|
let baseUrl = iframeSrc
|
|
|
let hashPart = ''
|
|
|
-
|
|
|
+ let isHashPart = false
|
|
|
// 分离base URL和hash部分
|
|
|
if (iframeSrc.includes('#')) {
|
|
|
const parts = iframeSrc.split('#')
|
|
|
baseUrl = parts[0]
|
|
|
hashPart = parts[1]
|
|
|
+ isHashPart = true
|
|
|
}
|
|
|
|
|
|
// 构建新的hash部分,添加参数
|
|
|
@@ -1401,7 +1402,10 @@ const processIframeLinks = async () => {
|
|
|
}
|
|
|
|
|
|
// 构建新的URL
|
|
|
- const newUrl = `${baseUrl}#${newHash}`
|
|
|
+ let newUrl = `${baseUrl}#${newHash}`
|
|
|
+ if (!isHashPart) {
|
|
|
+ newUrl = `${baseUrl}${newHash}`
|
|
|
+ }
|
|
|
|
|
|
console.log(`幻灯片 ${slideIndex + 1} 的iframe链接已更新:`, newUrl)
|
|
|
// 返回更新后的元素
|