Skip to content

Commit

Permalink
fix: 修复插件传参错误;修复资源文档导入传参错误;修复组件文档认证信息错误 (#834)
Browse files Browse the repository at this point in the history
* feat: 修复编辑基础信息弹框中维护人员不回显的问题
# Reviewed, transaction id: 10102

* feat: 全局配置
# Reviewed, transaction id: 10269

* feat: 修复基本信息编辑时,弹框中维护人员不显示的问题;获取全局配置 BK_APP_CODE 动态获取
# Reviewed, transaction id: 10784

* feat: 优化全局配置相关逻辑;全局配置增加本地开发 mock 接口
# Reviewed, transaction id: 10836

* feat: 修复编辑基础信息弹框中维护人员不回显的问题
# Reviewed, transaction id: 11294

* feat: 退出登录文案规范化
# Reviewed, transaction id: 11680

* deps(release-note): 更新release-note版本至beta14
# Reviewed, transaction id: 13772

* Merge remote-tracking branch 'base/release/1.13' into release/1.13
, # Reviewed, transaction id: 14655

* Feat 更改新LOGO (#81)

* feat: 更改新LOGO
# Reviewed, transaction id: 14692

* fix: 更正文本

* fix: 更正文本

* fix: 更正文本

* Merge remote-tracking branch 'base/release/1.13' into release/1.13
, # Reviewed, transaction id: 14922

* fix: 替换 favicon 和导航 title (#85)

# Reviewed, transaction id: 15075

* Fix 资源文档导入逻辑、样式优化和修复 (#92)

* fix: 调整文档勾选/覆盖/新增逻辑

* feat: 资源文档导入页逻辑优化和修正
# Reviewed, transaction id: 15312

* fix: 修复时间选择器手动输入无效的问题 (#90)

# Reviewed, transaction id: 15232

* Fix 时间选择器手动输入日期无效问题 (#95)

* fix: 修复时间选择器手动输入无效的问题
# Reviewed, transaction id: 15232

* fix: 修复日期选择器手动输入日期不生效的问题
# Reviewed, transaction id: 15344

* Merge remote-tracking branch 'base/release/1.13' into release/1.13
, # Reviewed, transaction id: 15533

* Merge branch 'release/1.13' of https://github.com/ielgnaw/blueking-apigateway into release/1.13
, # Reviewed, transaction id: 15534

* Fix 修复插件传参错误;修复资源文档导入传参错误; (#105)

* fix(plugin-manage\plugin-info.vue): 修复在 slider 内切换到 ip访问保护 插件时参数错误的问题

* fix(setting\import-doc.vue): 资源文档导入传参修复
# Reviewed, transaction id: 16219

* hotfix(doc.vue): 修复组件文档认证信息错误 (#102)

# Reviewed, transaction id: 16192

---------

Co-authored-by: KDZhu <carlchu0113@gmail.com>
  • Loading branch information
ielgnaw and Carlmac authored Aug 23, 2024
1 parent a45115b commit 431317a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@
<div class="k">{{ t('应用认证') }}<i
class="ml5 icon apigateway-icon icon-ag-help"
v-bk-tooltips="t('应用访问该组件API时,是否需提供应用认证信息')"></i>:</div>
<div class="v">{{ curComponent.app_verified_required ? t('是') : t('否') }}</div>
<div class="v">
{{ (curComponent.verified_app_required || curComponent.app_verified_required) ? t('是') : t('否') }}
</div>
</div>
<div class="kv-row">
<div class="k">{{ t('用户认证') }}<i
class="ml5 icon apigateway-icon icon-ag-help"
v-bk-tooltips="t('应用访问该组件API时,是否需要提供用户认证信息')"></i>:</div>
<div class="v">{{ curComponent.user_verified_required ? t('是') : t('否') }}</div>
<div class="v">
{{ (curComponent.verified_user_required || curComponent.user_verified_required) ? t('是') : t('否') }}
</div>
</div>
<div class="kv-row">
<div class="k">{{ t('是否需申请权限') }}<i
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@
</template>

<script setup lang="ts">
import { computed, ref, toRefs } from 'vue';
import {
computed,
ref,
toRefs,
} from 'vue';
import { useI18n } from 'vue-i18n';
import { getPluginForm, creatPlugin, updatePluginConfig } from '@/http';
import { Message } from 'bkui-vue';
Expand Down Expand Up @@ -464,6 +468,12 @@ const getSchemaFormData = async (code: string) => {
// type_name: '频率控制',
// };
// 当使用 select 组件切换到 ip 访问保护插件时,schemaFormData 没有被正确地设置
// 需要手动重置 schemaFormData
if (code === 'bk-ip-restriction') {
schemaFormData.value = { whitelist: '' };
}
isPluginFormLoading.value = false;
infoNotes.value = res.notes;
formConfig.value = res.config;
Expand Down
23 changes: 13 additions & 10 deletions src/dashboard-front/src/views/resource/setting/import-doc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
class="mt15" :class="curView === 'import' ? 'btn-container' : ''"
v-if="docType === 'swagger' || curView === 'resources'">
<bk-button
class="mr8"
:theme="curView === 'import' ? 'primary' : ''"
@click="handleCheckData"
:loading="isDataLoading"
Expand All @@ -190,7 +191,7 @@
</bk-button>
<span v-bk-tooltips="{ content: t('请确认勾选资源'), disabled: selections.length }" v-if="curView === 'resources'">
<bk-button
class="mr10"
class="mr8"
theme="primary"
type="button"
:disabled="!selections.length"
Expand Down Expand Up @@ -338,30 +339,32 @@ const handleCheckData = async () => {
const handleImportDoc = async () => {
try {
isImportLoading.value = true;
// 压缩包需要的参数
const formData = new FormData();
formData.append('file', zipFile.value);
formData.append('selected_resource_docs', JSON.stringify(selections.value));
// swagger需要的参数
const resourceDocs = selections.value.map((e: any) => ({
language: e.doc.language,
resource_name: e.name,
language: e.language || e.doc?.language,
resource_name: e.resource?.name || e.name,
}));
// 压缩包需要的参数
const formData = new FormData();
formData.append('file', zipFile.value);
// formData.append('selected_resource_docs', JSON.stringify(selections.value));
formData.append('selected_resource_docs', JSON.stringify(resourceDocs));
const paramsSwagger = {
swagger: editorText.value,
selected_resource_docs: resourceDocs,
language: language.value,
};
const parmas = docType.value === 'archive' ? formData : paramsSwagger;
const params = docType.value === 'archive' ? formData : paramsSwagger;
const fetchUrl: any = docType.value === 'archive' ? importResourceDoc : importResourceDocSwagger;
const message = docType.value === 'archive' ? '资源文档' : '资源';
await fetchUrl(apigwId, parmas);
await fetchUrl(apigwId, params);
Message({
theme: 'success',
message: t(`${message}导入成功`),
});
isImportLoading.value = false;
goBack();
} catch (error) {} finally {
} catch {
isImportLoading.value = false;
}
};
Expand Down

0 comments on commit 431317a

Please sign in to comment.