diff --git a/apps/web-antd/src/api/license/license/index.ts b/apps/web-antd/src/api/license/license/index.ts index 4ccc5a8..6500f7a 100644 --- a/apps/web-antd/src/api/license/license/index.ts +++ b/apps/web-antd/src/api/license/license/index.ts @@ -49,6 +49,11 @@ export function updateLicense(data: LicenseApi.License) { return requestClient.put('/license/license/update', data); } +/** 申请License */ +export function applyLicense(data: LicenseApi.License) { + return requestClient.put('/license/license/apply', data); +} + /** 删除License */ export function deleteLicense(id: number) { return requestClient.delete(`/license/license/delete?id=${id}`); diff --git a/apps/web-antd/src/views/license/license/modules/form.vue b/apps/web-antd/src/views/license/license/modules/form.vue index 30971f7..32d8cdf 100644 --- a/apps/web-antd/src/views/license/license/modules/form.vue +++ b/apps/web-antd/src/views/license/license/modules/form.vue @@ -9,6 +9,7 @@ import { message } from 'ant-design-vue'; import { useVbenForm } from '#/adapter/form'; import { + applyLicense, createLicense, getLicense, updateLicense, @@ -87,7 +88,13 @@ const [Modal, modalApi] = useVbenModal({ const data = (await formApi.getValues()) as LicenseApi.License; data.neSwitch = state.checkedList; try { - await (formData.value?.id ? updateLicense(data) : createLicense(data)); + if (formData.value?.id) { + await (formData.value?.action === 1 + ? applyLicense(data) + : updateLicense(data)); + } else { + await createLicense(data); + } // 关闭并提示 await modalApi.close(); emit('success');