diff --git a/ruoyi-ui/src/views/system/client/index.vue b/ruoyi-ui/src/views/system/client/index.vue index e78870e4..fea107fc 100644 --- a/ruoyi-ui/src/views/system/client/index.vue +++ b/ruoyi-ui/src/views/system/client/index.vue @@ -54,7 +54,7 @@ - + @@ -98,7 +98,14 @@ - + + + {{dict.dictLabel}} + + @@ -140,6 +147,8 @@ export default { title: "", // 是否显示弹出层 open: false, + // 终端授权类型字典 + authorizedGrantTypesOptions: [], // 查询参数 queryParams: { pageNum: 1, @@ -169,6 +178,9 @@ export default { }, created() { this.getList(); + this.getDicts("sys_grant_type").then(response => { + this.authorizedGrantTypesOptions = response.data; + }); }, methods: { /** 查询终端列表 */ @@ -180,6 +192,10 @@ export default { this.loading = false; }); }, + // 终端授权类型字典翻译 + authorizedGrantTypesFormat(row, column) { + return this.selectDictLabels(this.authorizedGrantTypesOptions, row.authorizedGrantTypes); + }, // 取消按钮 cancel() { this.open = false; @@ -191,7 +207,7 @@ export default { clientId: undefined, clientSecret: undefined, scope: "server", - authorizedGrantTypes: "password,refresh_token", + authorizedGrantTypes: [], accessTokenValidity: 3600, refreshTokenValidity: 7200 }; @@ -227,6 +243,7 @@ export default { const clientId = row.clientId || this.ids; getClient(clientId).then(response => { this.form = response.data; + this.form.authorizedGrantTypes = this.form.authorizedGrantTypes.split(","); this.open = true; this.title = "修改终端"; }); @@ -235,6 +252,7 @@ export default { submitForm: function() { this.$refs["form"].validate(valid => { if (valid) { + this.form.authorizedGrantTypes = this.form.authorizedGrantTypes.join(","); if (!this.isAdd && this.form.clientId != undefined) { updateClient(this.form).then(response => { if (response.code === 200) { diff --git a/sql/ry_20200822.sql b/sql/ry_20200823.sql similarity index 96% rename from sql/ry_20200822.sql rename to sql/ry_20200823.sql index 5a5b170a..2e7acd79 100644 --- a/sql/ry_20200822.sql +++ b/sql/ry_20200823.sql @@ -461,6 +461,7 @@ insert into sys_dict_type values(7, '通知类型', 'sys_notice_type', '0', insert into sys_dict_type values(8, '通知状态', 'sys_notice_status', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '通知状态列表'); insert into sys_dict_type values(9, '操作类型', 'sys_oper_type', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '操作类型列表'); insert into sys_dict_type values(10, '系统状态', 'sys_common_status', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '登录状态列表'); +insert into sys_dict_type values(11, '授权类型', 'sys_grant_type', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '授权类型列表'); -- ---------------------------- @@ -514,6 +515,11 @@ insert into sys_dict_data values(25, 8, '生成代码', '8', 'sys_oper_ty insert into sys_dict_data values(26, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '清空操作'); insert into sys_dict_data values(27, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态'); insert into sys_dict_data values(28, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '停用状态'); +insert into sys_dict_data values(29, 1, '授权码模式', 'authorization_code', 'sys_grant_type', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '授权码模式'); +insert into sys_dict_data values(30, 2, '密码模式', 'password', 'sys_grant_type', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '密码模式'); +insert into sys_dict_data values(31, 3, '客户端模式', 'client_credentials', 'sys_grant_type', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '客户端模式'); +insert into sys_dict_data values(32, 4, '简化模式', 'implicit', 'sys_grant_type', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '简化模式'); +insert into sys_dict_data values(33, 5, '刷新模式', 'refresh_token', 'sys_grant_type', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '刷新模式'); -- ----------------------------