diff --git a/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue b/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue index e8473a011d..ee59868bcf 100644 --- a/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue +++ b/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue @@ -18,11 +18,9 @@ import { EQUAL } from '@/components/pure/ms-advance-filter/index'; import paramsTable, { type ParamTableColumn } from '@/views/api-test/components/paramTable.vue'; - import { responseHeaderOption } from '@/config/apiTest'; - import type { ExecuteAssertionItem } from '@/models/apiTest/common'; - import { statusCodeOptions } from './utils'; + import { responseHeaderOption, statusCodeOptions } from './utils'; interface Param { [key: string]: any; diff --git a/frontend/src/components/business/ms-assertion/comp/utils.ts b/frontend/src/components/business/ms-assertion/comp/utils.ts index 12cb4d21e6..691743aab3 100644 --- a/frontend/src/components/business/ms-assertion/comp/utils.ts +++ b/frontend/src/components/business/ms-assertion/comp/utils.ts @@ -14,4 +14,18 @@ import { export const statusCodeOptions = [CONTAINS, NO_CONTAINS, EQUAL, NOT_EQUAL]; export const codeOptions = [CONTAINS, NO_CONTAINS, EQUAL, NOT_EQUAL, NO_CHECK]; +// 断言响应头 +export const responseHeaderOption = [ + { label: 'Content-Type', value: 'Content-Type' }, + { label: 'Content-Length', value: 'Content-Length' }, + { label: 'Content-Control', value: 'Content-Control' }, + { label: 'Content-Disposition', value: 'Content-Disposition' }, + { label: 'Content-Encoding', value: 'Content-Encoding' }, + { label: 'Location', value: 'Location' }, + { label: 'Set-Cookie', value: 'Set-Cookie' }, + { label: 'Access-Control-Allow-Origin', value: 'Access-Control-Allow-Origin' }, + { label: 'Expires', value: 'Expires' }, + { label: 'Last-Modified', value: 'Last-Modified' }, +]; + export default {}; diff --git a/frontend/src/components/business/ms-common-script/utils.ts b/frontend/src/components/business/ms-common-script/utils.ts index 5629ca6153..1129bcd73a 100644 --- a/frontend/src/components/business/ms-common-script/utils.ts +++ b/frontend/src/components/business/ms-common-script/utils.ts @@ -35,23 +35,23 @@ export const SCRIPT_MENU: CommonScriptMenu[] = [ }, { title: t('project.processor.codeTemplateGetVariable'), - value: 'vars.get("variable_name")', + value: 'vars.get("variable_name");', }, { title: t('project.processor.codeTemplateSetVariable'), - value: 'vars.put("variable_name", "variable_value")', + value: 'vars.put("variable_name", "variable_value");', }, { title: t('project.processor.codeTemplateGetResponseHeader'), - value: 'prev.getResponseHeaders()', + value: 'prev.getResponseHeaders();', }, { title: t('project.processor.codeTemplateGetResponseCode'), - value: 'prev.getResponseCode()', + value: 'prev.getResponseCode();', }, { title: t('project.processor.codeTemplateGetResponseResult'), - value: 'prev.getResponseDataAsString()', + value: 'prev.getResponseDataAsString();', }, { title: t('project.processor.paramEnvironmentSetGlobalVariable'), diff --git a/frontend/src/components/pure/navbar/taskCenterModal.vue b/frontend/src/components/pure/navbar/taskCenterModal.vue index 4e7d45b59f..b33ec46313 100644 --- a/frontend/src/components/pure/navbar/taskCenterModal.vue +++ b/frontend/src/components/pure/navbar/taskCenterModal.vue @@ -21,13 +21,15 @@
- + + +
diff --git a/frontend/src/views/setting/system/authorizedManagement/index.vue b/frontend/src/views/setting/system/authorizedManagement/index.vue index dd449e2b37..5ec5094703 100644 --- a/frontend/src/views/setting/system/authorizedManagement/index.vue +++ b/frontend/src/views/setting/system/authorizedManagement/index.vue @@ -42,7 +42,7 @@
  • {{ t('system.authorized.authorizationsCount') }}
    {{ licenseInfo?.license?.count }}
    {{ addCommasToNumber(licenseInfo?.license?.count || 0) }}
  • @@ -99,7 +99,7 @@ :auto-size="{ minRows: 3, }" - :rules="[{ required: true }]" + :rules="[{ required: true, message: t('system.authorized.LicenseIsRequired') }]" :max-length="1000" > @@ -124,6 +124,7 @@ import { addLicense, getLicenseInfo } from '@/api/modules/setting/authorizedManagement'; import { useI18n } from '@/hooks/useI18n'; import useLicenseStore from '@/store/modules/setting/license'; + import { addCommasToNumber } from '@/utils'; import type { LicenseInfo } from '@/models/setting/authorizedManagement'; @@ -149,11 +150,18 @@ loading.value = false; } }; + const authDrawer = ref(false); const drawerLoading = ref(false); const authFormRef = ref(null); const fileList = ref([]); + const cancelHandler = () => { + authDrawer.value = false; + fileList.value = []; + authFormRef.value?.resetFields(); + }; + const confirmHandler = () => { authFormRef.value?.validate(async (errors: undefined | Record) => { if (!errors) { @@ -163,6 +171,7 @@ authDrawer.value = false; Message.success(t('system.authorized.licenseSuccessTip')); getLicenseDetail(); + cancelHandler(); } catch (error) { console.log(error); } finally { @@ -174,12 +183,6 @@ }); }; - const cancelHandler = () => { - authDrawer.value = false; - fileList.value = []; - authFormRef.value?.resetFields(); - }; - const authChecking = () => { authDrawer.value = true; }; @@ -192,6 +195,7 @@ reader.readAsText((fileList.value[0] as any)?.file, 'UTF-8'); reader.onload = (e) => { authorizedForm.licenseCode = e.target?.result; + authFormRef.value?.validate(); }; }; @@ -204,6 +208,15 @@ } ); + // watch( + // () => authorizedForm.value.licenseCode, + // (val) => { + // if (val.trim().length) { + // authFormRef.value?.validate(); + // } + // } + // ); + onBeforeMount(() => { getLicenseDetail(); }); diff --git a/frontend/src/views/setting/system/authorizedManagement/locale/en-US.ts b/frontend/src/views/setting/system/authorizedManagement/locale/en-US.ts index 71f895414c..04753e8ef9 100644 --- a/frontend/src/views/setting/system/authorizedManagement/locale/en-US.ts +++ b/frontend/src/views/setting/system/authorizedManagement/locale/en-US.ts @@ -14,4 +14,5 @@ export default { 'system.authorized.license': 'License', 'system.authorized.licenseCode': 'License Code', 'system.authorized.licenseSuccessTip': 'Authorized Successfully!', + 'system.authorized.LicenseIsRequired': 'License Code is required', }; diff --git a/frontend/src/views/setting/system/authorizedManagement/locale/zh-CN.ts b/frontend/src/views/setting/system/authorizedManagement/locale/zh-CN.ts index 55d4975d43..02e5235a06 100644 --- a/frontend/src/views/setting/system/authorizedManagement/locale/zh-CN.ts +++ b/frontend/src/views/setting/system/authorizedManagement/locale/zh-CN.ts @@ -14,4 +14,5 @@ export default { 'system.authorized.license': 'License', 'system.authorized.licenseCode': 'License Code', 'system.authorized.licenseSuccessTip': '授权成功', + 'system.authorized.LicenseIsRequired': 'License Code 是必填项', };