From 08b45bc9b329e986d5db5b487eac478f7fe33249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E8=90=8C=E5=93=92=E8=B5=AB=E8=90=9D?= Date: Wed, 6 Sep 2023 19:16:57 -0700 Subject: [PATCH] :sparkles: Feature: optimize api copy --- src/renderer/pages/picbeds/index.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/renderer/pages/picbeds/index.vue b/src/renderer/pages/picbeds/index.vue index 0317871..47acb44 100644 --- a/src/renderer/pages/picbeds/index.vue +++ b/src/renderer/pages/picbeds/index.vue @@ -241,6 +241,10 @@ async function handleCopyApi () { 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) + if (!picBedConfig) { + ElMessage.error('No config found') + return + } const apiUrl = `http://${host}:${port}/upload?picbed=${$route.params.type}&configName=${picBedConfig?._configName}` clipboard.writeText(apiUrl) ElMessage.success($T('MANAGE_BUCKET_COPY_SUCCESS') + ' ' + apiUrl)