Skip to content

Commit c129725

Browse files
xbsura11000100111010101100111
authored andcommitted
feat: support client Id edit
1 parent babfb9f commit c129725

File tree

5 files changed

+8961
-4902
lines changed

5 files changed

+8961
-4902
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ export default {
229229
application_true: 'Yes',
230230
application_false: 'No',
231231
application_create: 'Create a client',
232+
application_client_id_placeholder: 'Can be left empty, system will auto-generate',
232233
//api 监控
233234
api_monitor_total_totalCount: 'Total number of APIs',
234235
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
@@ -225,6 +225,7 @@ export default {
225225
application_true: '是',
226226
application_false: '否',
227227
application_create: '创建客户端',
228+
application_client_id_placeholder: '可留空,系统将自动生成',
228229
//api 监控
229230
api_monitor_total_totalCount: 'API总数',
230231
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
@@ -225,6 +225,7 @@ export default {
225225
application_true: '是',
226226
application_false: '否',
227227
application_create: '創建客戶端',
228+
application_client_id_placeholder: '可留空,系統將自動生成',
228229
//api 监控
229230
api_monitor_total_totalCount: 'API總數',
230231
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
@@ -87,6 +87,9 @@
8787
<ElFormItem :label="$t('application_header_client_name')" required prop="clientName">
8888
<ElInput v-model="createForm.clientName"></ElInput>
8989
</ElFormItem>
90+
<ElFormItem :label="$t('application_header_id')" prop="clientId">
91+
<ElInput v-model="createForm.clientId" size="mini" :placeholder="$t('application_client_id_placeholder')"></ElInput>
92+
</ElFormItem>
9093
<ElFormItem :label="$t('application_header_grant_type')" required prop="grantTypes">
9194
<ElSelect v-model="createForm.grantTypes" multiple>
9295
<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: [],
@@ -239,6 +244,11 @@ export default {
239244
params.redirectUris = params.redirectUrisStr?.split(',') || []
240245
delete params['redirectUrisStr']
241246
247+
// 如果clientId为空,则不传递该字段
248+
if (!params.clientId || params.clientId.trim() === '') {
249+
delete params['clientId']
250+
}
251+
242252
this.$refs.form.validate((valid) => {
243253
if (valid) {
244254
applicationApi[method](params).then(() => {

0 commit comments

Comments
 (0)