mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-06-02 22:31:49 +08:00
@@ -4,11 +4,13 @@ import { handleUrlEncode } from '#/utils/common'
|
||||
const formatCustomLink = (customLink: string, item: ImgInfo) => {
|
||||
const fileName = item.fileName!.replace(new RegExp(`\\${item.extname}$`), '')
|
||||
const url = item.url || item.imgUrl
|
||||
const extName = item.extname
|
||||
const formatObj = {
|
||||
url,
|
||||
fileName
|
||||
fileName,
|
||||
extName
|
||||
}
|
||||
const keys = Object.keys(formatObj) as ['url', 'fileName']
|
||||
const keys = Object.keys(formatObj) as ['url', 'fileName', 'extName']
|
||||
keys.forEach(item => {
|
||||
if (customLink.indexOf(`$${item}`) !== -1) {
|
||||
const reg = new RegExp(`\\$${item}`, 'g')
|
||||
|
||||
Reference in New Issue
Block a user