Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zlt2000
microservices-platform
提交
35fa3dba
microservices-platform
项目概览
zlt2000
/
microservices-platform
9 个月 前同步成功
通知
16
Star
4
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
microservices-platform
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
35fa3dba
编写于
6月 06, 2020
作者:
zlt2000
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化应用管理编辑页面和列表
上级
bd7911cc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
61 addition
and
10 deletion
+61
-10
zlt-doc/sql/oauth-center.sql
zlt-doc/sql/oauth-center.sql
+1
-1
zlt-uaa/src/main/resources/mapper/ClientMapper.xml
zlt-uaa/src/main/resources/mapper/ClientMapper.xml
+3
-0
zlt-web/back-web/src/main/resources/static/pages/attestation/app.html
...-web/src/main/resources/static/pages/attestation/app.html
+57
-9
未找到文件。
zlt-doc/sql/oauth-center.sql
浏览文件 @
35fa3dba
...
...
@@ -18,7 +18,7 @@ CREATE TABLE `oauth_client_details` (
`access_token_validity`
int
(
11
)
NULL
DEFAULT
NULL
COMMENT
'access_token有效期'
,
`refresh_token_validity`
int
(
11
)
NULL
DEFAULT
NULL
COMMENT
'refresh_token有效期'
,
`additional_information`
varchar
(
4096
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
'{}'
COMMENT
'{}'
,
`autoapprove`
char
(
4
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NOT
NULL
DEFAULT
'true'
COMMENT
'是否自动授权 是-true'
,
`autoapprove`
char
(
5
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NOT
NULL
DEFAULT
'true'
COMMENT
'是否自动授权 是-true'
,
`create_time`
datetime
(
0
)
NULL
DEFAULT
NULL
,
`update_time`
datetime
(
0
)
NULL
DEFAULT
NULL
,
`client_name`
varchar
(
128
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
''
COMMENT
'应用名称'
,
...
...
zlt-uaa/src/main/resources/mapper/ClientMapper.xml
浏览文件 @
35fa3dba
...
...
@@ -47,6 +47,9 @@
<select
id=
"findList"
resultType=
"com.central.oauth.model.Client"
>
select id, client_id, client_name, resource_ids
, client_secret, client_secret_str, web_server_redirect_uri
, scope, authorized_grant_types, autoapprove
, access_token_validity accessTokenValiditySeconds
, refresh_token_validity refreshTokenValiditySeconds
from oauth_client_details
<include
refid=
"where"
/>
</select>
...
...
zlt-web/back-web/src/main/resources/static/pages/attestation/app.html
浏览文件 @
35fa3dba
...
...
@@ -26,7 +26,7 @@
<!-- 表单弹窗 -->
<script
type=
"text/html"
id=
"app-model"
>
<
form
id
=
"
app-form
"
lay
-
filter
=
"
app-form
"
class
=
"
layui-form model-form
"
>
<
form
id
=
"
app-form
"
method
=
"
POST
"
lay
-
filter
=
"
app-form
"
class
=
"
layui-form model-form
"
>
<
input
name
=
"
id
"
type
=
"
hidden
"
/>
<
div
class
=
"
layui-form-item
"
>
<
label
class
=
"
layui-form-label
"
>
应用标识
<
/label>
...
...
@@ -54,6 +54,35 @@
<
input
name
=
"
webServerRedirectUri
"
placeholder
=
"
请输入回调地址
"
type
=
"
text
"
class
=
"
layui-input
"
maxlength
=
"
20
"
/>
<
/div>
<
/div>
<
div
class
=
"
layui-form-item
"
>
<
label
class
=
"
layui-form-label
"
>
自动审批
<
/label>
<
div
class
=
"
layui-input-block
"
>
<
input
type
=
"
radio
"
name
=
"
autoapprove
"
value
=
"
true
"
title
=
"
是
"
checked
/>
<
input
type
=
"
radio
"
name
=
"
autoapprove
"
value
=
"
false
"
title
=
"
否
"
/>
<
/div>
<
/div>
<
div
class
=
"
layui-form-item
"
>
<
label
class
=
"
layui-form-label
"
>
授权模式
<
/label>
<
div
class
=
"
layui-input-block
"
>
<
input
type
=
"
checkbox
"
name
=
"
authorizedGrantTypes
"
lay
-
skin
=
"
primary
"
title
=
"
授权码模式
"
value
=
"
authorization_code
"
checked
>
<
input
type
=
"
checkbox
"
name
=
"
authorizedGrantTypes
"
lay
-
skin
=
"
primary
"
title
=
"
密码模式
"
value
=
"
password
"
checked
>
<
input
type
=
"
checkbox
"
name
=
"
authorizedGrantTypes
"
lay
-
skin
=
"
primary
"
title
=
"
客户端模式
"
value
=
"
client_credentials
"
checked
>
<
input
type
=
"
checkbox
"
name
=
"
authorizedGrantTypes
"
lay
-
skin
=
"
primary
"
title
=
"
简化模式
"
value
=
"
implicit
"
checked
>
<
input
type
=
"
checkbox
"
name
=
"
authorizedGrantTypes
"
lay
-
skin
=
"
primary
"
title
=
"
刷新Token
"
value
=
"
refresh_token
"
checked
>
<
/div>
<
/div>
<
div
class
=
"
layui-form-item
"
>
<
label
class
=
"
layui-form-label
"
>
令牌时效
(
s
)
<
/label>
<
div
class
=
"
layui-input-block
"
>
<
input
name
=
"
accessTokenValiditySeconds
"
lay
-
verify
=
"
number
"
type
=
"
text
"
class
=
"
layui-input
"
maxlength
=
"
20
"
value
=
"
18000
"
/>
<
/div>
<
/div>
<
div
class
=
"
layui-form-item
"
>
<
label
class
=
"
layui-form-label
"
>
刷新时效
(
s
)
<
/label>
<
div
class
=
"
layui-input-block
"
>
<
input
name
=
"
refreshTokenValiditySeconds
"
lay
-
verify
=
"
number
"
type
=
"
text
"
class
=
"
layui-input
"
maxlength
=
"
20
"
value
=
"
28800
"
/>
<
/div>
<
/div>
<
div
class
=
"
layui-form-item model-form-footer
"
>
<
button
class
=
"
layui-btn layui-btn-primary
"
ew
-
event
=
"
closeDialog
"
type
=
"
button
"
>
取消
<
/button>
<
button
class
=
"
layui-btn
"
lay
-
filter
=
"
app-form-submit
"
lay
-
submit
>
保存
<
/button>
...
...
@@ -81,11 +110,15 @@
cols
:
[[
{
type
:
'
numbers
'
},
{
field
:
'
clientId
'
,
width
:
180
,
sort
:
true
,
title
:
'
应用标识
'
},
{
field
:
'
clientName
'
,
width
:
200
,
sort
:
true
,
title
:
'
应用名称
'
},
{
field
:
'
clientSecretStr
'
,
width
:
180
,
sort
:
true
,
title
:
'
应用密钥
'
},
{
field
:
'
webServerRedirectUri
'
,
sort
:
true
,
title
:
'
回调地址
'
},
{
field
:
'
clientName
'
,
width
:
180
,
sort
:
true
,
title
:
'
应用名称
'
},
{
field
:
'
webServerRedirectUri
'
,
width
:
250
,
sort
:
true
,
title
:
'
回调地址
'
},
{
field
:
'
authorizedGrantTypes
'
,
width
:
250
,
sort
:
true
,
title
:
'
oauth授权方式
'
},
{
align
:
'
center
'
,
width
:
150
,
toolbar
:
'
#app-table-bar
'
,
title
:
'
操作
'
}
{
width
:
110
,
sort
:
true
,
title
:
'
自动审批
'
,
templet
:
function
(
d
)
{
return
d
.
autoapprove
==
'
true
'
?
"
是
"
:
"
否
"
}},
{
field
:
'
accessTokenValiditySeconds
'
,
width
:
130
,
sort
:
true
,
title
:
'
令牌时效(s)
'
},
{
field
:
'
refreshTokenValiditySeconds
'
,
width
:
130
,
sort
:
true
,
title
:
'
刷新时效(s)
'
},
{
fixed
:
'
right
'
,
align
:
'
center
'
,
width
:
150
,
toolbar
:
'
#app-table-bar
'
,
title
:
'
操作
'
}
]]
});
...
...
@@ -132,18 +165,29 @@
type
:
1
,
title
:
data
?
'
修改应用
'
:
'
添加应用
'
,
area
:
'
450px
'
,
offset
:
'
12
0px
'
,
offset
:
'
8
0px
'
,
content
:
$
(
'
#app-model
'
).
html
(),
success
:
function
()
{
$
(
'
#app-form
'
)[
0
].
reset
();
$
(
'
#app-form
'
).
attr
(
'
method
'
,
'
POST
'
);
if
(
data
)
{
$
(
"
input[name='clientId']
"
).
attr
(
'
disabled
'
,
true
);
$
(
"
input[name='clientId']
"
).
attr
(
'
class
'
,
"
layui-input layui-disabled
"
);
$
(
"
input[name='webServerRedirectUri']
"
).
attr
(
'
disabled
'
,
true
);
$
(
"
input[name='webServerRedirectUri']
"
).
attr
(
'
class
'
,
"
layui-input layui-disabled
"
);
form
.
val
(
'
app-form
'
,
data
);
$
(
'
#app-form
'
).
attr
(
'
method
'
,
'
POST
'
);
let
authorizedGrantTypesArr
=
data
.
authorizedGrantTypes
.
split
(
"
,
"
);
$
(
'
input[type=checkbox][name=authorizedGrantTypes]
'
).
each
(
function
()
{
let
typeValue
=
$
(
this
).
val
();
let
isCheck
=
false
;
for
(
var
i
=
0
;
i
<
authorizedGrantTypesArr
.
length
;
i
++
)
{
if
(
typeValue
===
authorizedGrantTypesArr
[
i
])
{
isCheck
=
true
;
break
;
}
}
$
(
this
).
prop
(
"
checked
"
,
isCheck
);
});
}
}
});
...
...
@@ -151,10 +195,14 @@
// 表单提交事件
form
.
on
(
'
submit(app-form-submit)
'
,
function
(
data
)
{
let
authorizedGrantTypesArr
=
[];
$
(
'
input[type=checkbox][name=authorizedGrantTypes]:checked
'
).
each
(
function
()
{
authorizedGrantTypesArr
.
push
(
$
(
this
).
val
());
});
data
.
field
.
authorizedGrantTypes
=
authorizedGrantTypesArr
.
join
(
"
,
"
);
layer
.
load
(
2
);
admin
.
req
(
'
api-uaa/clients/saveOrUpdate
'
,
JSON
.
stringify
(
data
.
field
),
function
(
data
)
{
layer
.
closeAll
(
'
loading
'
);
console
.
log
(
data
);
if
(
data
.
resp_code
==
0
)
{
layer
.
msg
(
data
.
resp_msg
,
{
icon
:
1
,
time
:
500
});
table
.
reload
(
'
app-table
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录