|
@@ -220,10 +220,41 @@ const menuInitialized = ref(false)
|
|
|
const activeMenuKey = 'aiPoetryCourseActiveMenu'
|
|
const activeMenuKey = 'aiPoetryCourseActiveMenu'
|
|
|
const activeIndexKey = 'aiPoetryCourseActiveIndex'
|
|
const activeIndexKey = 'aiPoetryCourseActiveIndex'
|
|
|
|
|
|
|
|
|
|
+const encodeImageUrl = (url) => {
|
|
|
|
|
+ if (!url) return url
|
|
|
|
|
+ try {
|
|
|
|
|
+ const decoded = decodeURI(url)
|
|
|
|
|
+ const lastSlash = decoded.lastIndexOf('/')
|
|
|
|
|
+ if (lastSlash === -1) {
|
|
|
|
|
+ return encodeURIComponent(decoded).replace(/[!'()*]/g, c => '%' + c.charCodeAt(0).toString(16).toUpperCase())
|
|
|
|
|
+ }
|
|
|
|
|
+ const base = decoded.substring(0, lastSlash + 1)
|
|
|
|
|
+ const filename = decoded.substring(lastSlash + 1)
|
|
|
|
|
+ const encodedFilename = encodeURIComponent(filename)
|
|
|
|
|
+ .replace(/[!'()*]/g, c => '%' + c.charCodeAt(0).toString(16).toUpperCase())
|
|
|
|
|
+ return base + encodedFilename
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const lastSlash = url.lastIndexOf('/')
|
|
|
|
|
+ if (lastSlash === -1) {
|
|
|
|
|
+ return encodeURIComponent(url).replace(/[!'()*]/g, c => '%' + c.charCodeAt(0).toString(16).toUpperCase())
|
|
|
|
|
+ }
|
|
|
|
|
+ const base = url.substring(0, lastSlash + 1)
|
|
|
|
|
+ const filename = url.substring(lastSlash + 1)
|
|
|
|
|
+ const encodedFilename = encodeURIComponent(filename)
|
|
|
|
|
+ .replace(/[!'()*]/g, c => '%' + c.charCodeAt(0).toString(16).toUpperCase())
|
|
|
|
|
+ return base + encodedFilename
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ return url
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const processCourseData = (data) => {
|
|
const processCourseData = (data) => {
|
|
|
return data.map((item, index) => {
|
|
return data.map((item, index) => {
|
|
|
item.ctTypeSort = index + 1
|
|
item.ctTypeSort = index + 1
|
|
|
item.ctTypeSort = item.ctTypeSort > 9 ? item.ctTypeSort : "0" + item.ctTypeSort
|
|
item.ctTypeSort = item.ctTypeSort > 9 ? item.ctTypeSort : "0" + item.ctTypeSort
|
|
|
|
|
+ item.ctTypeImage = encodeImageUrl(item.ctTypeImage)
|
|
|
return item
|
|
return item
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|