Skip to content

Commit 04ec3b4

Browse files
authored
Merge pull request #414 from tapdata/v327/feat/edit-clientId
2 parents 02abf64 + 94000cf commit 04ec3b4

File tree

5 files changed

+9587
-7562
lines changed

5 files changed

+9587
-7562
lines changed

apps/daas/src/i18n/langs/en.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ export default {
226226
application_true: 'Yes',
227227
application_false: 'No',
228228
application_create: 'Create a client',
229+
application_client_id_placeholder: 'Can be left empty, system will auto-generate',
229230
//api 监控
230231
api_monitor_total_totalCount: 'Total number of APIs',
231232
api_monitor_total_warningApiCount: 'Total API Access',

apps/daas/src/i18n/langs/zh-CN.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ export default {
223223
application_true: '是',
224224
application_false: '否',
225225
application_create: '创建客户端',
226+
application_client_id_placeholder: '可留空,系统将自动生成',
226227
//api 监控
227228
api_monitor_total_totalCount: 'API总数',
228229
api_monitor_total_warningApiCount: 'API访问总数',

apps/daas/src/i18n/langs/zh-TW.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ export default {
223223
application_true: '是',
224224
application_false: '否',
225225
application_create: '創建客戶端',
226+
application_client_id_placeholder: '可留空,系統將自動生成',
226227
//api 监控
227228
api_monitor_total_totalCount: 'API總數',
228229
api_monitor_total_warningApiCount: 'API訪問總數',

apps/daas/src/views/api-page/Applications.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@
9292
<ElFormItem :label="$t('application_header_client_name')" required prop="clientName">
9393
<ElInput v-model="createForm.clientName" size="mini"></ElInput>
9494
</ElFormItem>
95+
<ElFormItem :label="$t('application_header_id')" prop="clientId">
96+
<ElInput v-model="createForm.clientId" size="mini" :placeholder="$t('application_client_id_placeholder')"></ElInput>
97+
</ElFormItem>
9598
<ElFormItem :label="$t('application_header_grant_type')" required prop="grantTypes">
9699
<ElSelect v-model="createForm.grantTypes" multiple size="mini">
97100
<ElOption label="Implicit" value="implicit"></ElOption>
@@ -159,6 +162,7 @@ export default {
159162
roles: [],
160163
createForm: {
161164
clientName: '',
165+
clientId: '',
162166
grantTypes: [],
163167
clientSecret: '',
164168
scopes: [],
@@ -195,6 +199,7 @@ export default {
195199
})
196200
this.createForm = {
197201
clientName: '',
202+
clientId: '',
198203
grantTypes: ['implicit', 'client_credentials'],
199204
clientSecret: '',
200205
scopes: [],
@@ -240,6 +245,11 @@ export default {
240245
params.redirectUris = params.redirectUrisStr?.split(',') || []
241246
delete params['redirectUrisStr']
242247
248+
// 如果clientId为空,则不传递该字段
249+
if (!params.clientId || params.clientId.trim() === '') {
250+
delete params['clientId']
251+
}
252+
243253
this.$refs.form.validate(valid => {
244254
if (valid) {
245255
applicationApi[method](params).then(() => {

0 commit comments

Comments
 (0)