Feature: add piclist itself as a picbed

This commit is contained in:
Kuingsmile
2023-10-10 23:54:46 +08:00
parent 6e2210130b
commit 9f49fc0a7d
6 changed files with 41 additions and 8 deletions
+5 -1
View File
@@ -242,6 +242,7 @@ async function handleCopyApi () {
if (host === '0.0.0.0') {
host = '127.0.0.1'
}
const serverKey = await getConfig('settings.serverKey') || ''
const uploader = await getConfig('uploader') as IStringKeyMap || {}
const picBedConfigList = uploader[$route.params.type as string].configList || []
const picBedConfig = picBedConfigList.find((item: IUploaderConfigListItem) => item._id === $route.params.configId)
@@ -249,7 +250,10 @@ async function handleCopyApi () {
ElMessage.error('No config found')
return
}
const apiUrl = `http://${host}:${port}/upload?picbed=${$route.params.type}&configName=${picBedConfig?._configName}`
let apiUrl = `http://${host}:${port}/upload?picbed=${$route.params.type}&configName=${picBedConfig?._configName}`
if (serverKey) {
apiUrl += `&key=${serverKey}`
}
clipboard.writeText(apiUrl)
ElMessage.success($T('MANAGE_BUCKET_COPY_SUCCESS') + ' ' + apiUrl)
} catch (error) {