mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-22 00:30:33 +08:00
✨ Feature(custom): optimize upload api copy
This commit is contained in:
@@ -276,8 +276,14 @@ async function handleCopyApi() {
|
|||||||
message.error(t('pages.picBedConfigs.noConfigs'))
|
message.error(t('pages.picBedConfigs.noConfigs'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
const urlSearchParams = new URLSearchParams({
|
||||||
const apiUrl = `http://${host === '0.0.0.0' ? '127.0.0.1' : host}:${port}/upload?picbed=${$route.params.type}&configName=${picBedConfig._configName}${serverKey ? `&key=${serverKey}` : ''}`
|
picbed: $route.params.type as string,
|
||||||
|
configName: picBedConfig._configName,
|
||||||
|
})
|
||||||
|
if (serverKey) {
|
||||||
|
urlSearchParams.append('key', serverKey as string)
|
||||||
|
}
|
||||||
|
const apiUrl = `http://${host === '0.0.0.0' ? '127.0.0.1' : host}:${port}/upload?${urlSearchParams.toString()}`
|
||||||
|
|
||||||
try {
|
try {
|
||||||
window.electron.clipboard.writeText(apiUrl)
|
window.electron.clipboard.writeText(apiUrl)
|
||||||
|
|||||||
Reference in New Issue
Block a user