mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-07 08:22:55 +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'))
|
||||
return
|
||||
}
|
||||
|
||||
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}` : ''}`
|
||||
const urlSearchParams = new URLSearchParams({
|
||||
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 {
|
||||
window.electron.clipboard.writeText(apiUrl)
|
||||
|
||||
Reference in New Issue
Block a user