From 97eb387f10b2f96c5b88a816c24f770be4115e70 Mon Sep 17 00:00:00 2001 From: RogerWork Date: Mon, 29 Jul 2024 15:40:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9B=9E=E5=A4=8D=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC=EF=BC=8C=E5=92=8C=E9=94=99=E8=AF=AF=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ec_api/TabArea.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/ec_api/TabArea.vue b/src/components/ec_api/TabArea.vue index d5b64f4..47b27e6 100644 --- a/src/components/ec_api/TabArea.vue +++ b/src/components/ec_api/TabArea.vue @@ -98,6 +98,8 @@ function initApiData() { if (param_item['param'] === 'pid') { param_item['value'] = UserApiData.value['base_info']['channel'] } + // 写入默认值 + param_item['default'] = param_item['value'] } ) }) @@ -120,6 +122,16 @@ function addNewParams() { }) } +// 读取参数默认值 +function loadDefault(param) { + console.log(param) + UserApiData.value.api[activeTab.value]['params'].forEach( p => { + if (p['param'] === param) { + p['value'] = p['default'] + } + }) +} + // 准备获取url和发送请求需要的参数 function handle_request_data() { let data = {} @@ -254,7 +266,7 @@ onMounted(() => {