From 866331343c7cc85e8058b92aeea45abdd7edfa41 Mon Sep 17 00:00:00 2001
From: AceDataCloud
Date: Sun, 1 Jan 2023 00:38:03 +0800
Subject: [PATCH] add apply operation
---
src/constants/errorCode.ts | 1 +
src/i18n/zh/application/index.ts | 4 ++-
src/i18n/zh/application/message.ts | 4 +++
src/operators/application/models.ts | 10 +++----
src/pages/service/Detail.vue | 46 ++++++++++++++++++++++-------
src/pages/service/List.vue | 1 +
6 files changed, 50 insertions(+), 16 deletions(-)
create mode 100644 src/i18n/zh/application/message.ts
diff --git a/src/constants/errorCode.ts b/src/constants/errorCode.ts
index 22aac216..37ef5a28 100644
--- a/src/constants/errorCode.ts
+++ b/src/constants/errorCode.ts
@@ -1 +1,2 @@
export const ERROR_CODE_UNVERIFIED = 'unverifed';
+export const ERROR_CODE_DUPLICATION = 'duplication';
diff --git a/src/i18n/zh/application/index.ts b/src/i18n/zh/application/index.ts
index c61ce3af..3cd536a7 100644
--- a/src/i18n/zh/application/index.ts
+++ b/src/i18n/zh/application/index.ts
@@ -1,7 +1,9 @@
import field from './field';
import button from './button';
+import message from './message';
export default {
field,
- button
+ button,
+ message
};
diff --git a/src/i18n/zh/application/message.ts b/src/i18n/zh/application/message.ts
new file mode 100644
index 00000000..7dfe34bb
--- /dev/null
+++ b/src/i18n/zh/application/message.ts
@@ -0,0 +1,4 @@
+export default {
+ alreadyApplied: '已经申请过该服务,请到控制台查看',
+ applySuccessfully: '申请成功,即将跳转到控制台'
+};
diff --git a/src/operators/application/models.ts b/src/operators/application/models.ts
index 77be6ff6..bb75f157 100644
--- a/src/operators/application/models.ts
+++ b/src/operators/application/models.ts
@@ -1,10 +1,10 @@
export interface IApplication {
- id: string;
+ id?: string;
service: string;
- apiKey: string;
- userId: string;
- remainingCount: number;
- usedCount: number;
+ apiKey?: string;
+ userId?: string;
+ remainingCount?: number;
+ usedCount?: number;
createdAt?: string;
updatedAt?: string;
}
diff --git a/src/pages/service/Detail.vue b/src/pages/service/Detail.vue
index 8a1568f2..43e92561 100644
--- a/src/pages/service/Detail.vue
+++ b/src/pages/service/Detail.vue
@@ -30,7 +30,7 @@
-
+
{{ $t('service.button.apply') }}
@@ -61,12 +61,22 @@
diff --git a/src/pages/service/List.vue b/src/pages/service/List.vue
index 74616743..dc147450 100644
--- a/src/pages/service/List.vue
+++ b/src/pages/service/List.vue
@@ -46,6 +46,7 @@
import { serviceOperator, IService, IServiceListResponse } from '@/operators';
import { defineComponent } from 'vue';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
+import { ElForm, ElMessage } from 'element-plus';
interface IData {
services: IService[];