Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
b7bcdd1f
提交
b7bcdd1f
authored
9月 06, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 新增ldap
上级
cec9a85b
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
318 行增加
和
5 行删除
+318
-5
pom.xml
backend/pom.xml
+7
-2
XLdapServer.java
...src/main/java/io/dataease/plugins/server/XLdapServer.java
+28
-0
pom.xml
frontend/pom.xml
+1
-1
zh.js
frontend/src/lang/zh.js
+32
-1
index.vue
frontend/src/views/system/settings/index.vue
+21
-0
index.vue
frontend/src/views/system/settings/sso/index.vue
+21
-0
index.vue
frontend/src/views/system/settings/sso/ldap/index.vue
+0
-0
index.vue
frontend/src/views/system/settings/sso/oidc/index.vue
+0
-0
index.vue
frontend/src/views/system/settings/theme/index.vue
+10
-0
imp-ldap.vue
frontend/src/views/system/user/imp-ldap.vue
+191
-0
index.vue
frontend/src/views/system/user/index.vue
+6
-0
pom.xml
pom.xml
+1
-1
没有找到文件。
backend/pom.xml
浏览文件 @
b7bcdd1f
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
dataease-server
</artifactId>
<artifactId>
dataease-server
</artifactId>
<groupId>
io.dataease
</groupId>
<groupId>
io.dataease
</groupId>
<version>
1.
2
.0
</version>
<version>
1.
3
.0
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
@@ -316,7 +316,7 @@
...
@@ -316,7 +316,7 @@
<dependency>
<dependency>
<groupId>
io.dataease
</groupId>
<groupId>
io.dataease
</groupId>
<artifactId>
dataease-plugin-interface
</artifactId>
<artifactId>
dataease-plugin-interface
</artifactId>
<version>
1.
2
</version>
<version>
1.
3
</version>
</dependency>
</dependency>
<dependency>
<dependency>
...
@@ -337,6 +337,11 @@
...
@@ -337,6 +337,11 @@
<version>
5.7.4
</version>
<version>
5.7.4
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-ldap
</artifactId>
</dependency>
<!--<dependency>
<!--<dependency>
<groupId>org.apache.poi</groupId>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<artifactId>poi-ooxml</artifactId>
...
...
backend/src/main/java/io/dataease/plugins/server/XLdapServer.java
0 → 100644
浏览文件 @
b7bcdd1f
package
io
.
dataease
.
plugins
.
server
;
import
io.dataease.plugins.config.SpringContextUtil
;
import
io.dataease.plugins.xpack.display.dto.response.SysSettingDto
;
import
io.dataease.plugins.xpack.ldap.dto.response.LdapInfo
;
import
io.dataease.plugins.xpack.ldap.service.LdapXpackService
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@RequestMapping
(
"/api/ldap"
)
@RestController
public
class
XLdapServer
{
@GetMapping
(
"/info"
)
public
LdapInfo
getLdapInfo
()
{
LdapXpackService
ldapXpackService
=
SpringContextUtil
.
getBean
(
LdapXpackService
.
class
);
return
ldapXpackService
.
info
();
}
@PostMapping
(
"/save"
)
public
void
save
(
@RequestBody
List
<
SysSettingDto
>
settings
)
{
LdapXpackService
ldapXpackService
=
SpringContextUtil
.
getBean
(
LdapXpackService
.
class
);
ldapXpackService
.
save
(
settings
);
}
}
frontend/pom.xml
浏览文件 @
b7bcdd1f
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<parent>
<parent>
<artifactId>
dataease-server
</artifactId>
<artifactId>
dataease-server
</artifactId>
<groupId>
io.dataease
</groupId>
<groupId>
io.dataease
</groupId>
<version>
1.
2
.0
</version>
<version>
1.
3
.0
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
frontend/src/lang/zh.js
浏览文件 @
b7bcdd1f
...
@@ -496,7 +496,38 @@ export default {
...
@@ -496,7 +496,38 @@ export default {
new_passwd
:
'新密码'
,
new_passwd
:
'新密码'
,
confirm_passwd
:
'确认密码'
,
confirm_passwd
:
'确认密码'
,
change_password
:
'修改密码'
,
change_password
:
'修改密码'
,
search_by_name
:
'按姓名搜索'
search_by_name
:
'按姓名搜索'
,
import_ldap
:
'导入LDAP用户'
},
ldap
:
{
url
:
'LDAP地址'
,
dn
:
'绑定DN'
,
password
:
'密码'
,
ou
:
'用户OU'
,
filter
:
'用户过滤器'
,
mapping
:
'LDAP属性映射'
,
open
:
'启用LDAP认证'
,
input_url
:
'请输入LDAP地址'
,
input_dn
:
'请输入DN'
,
input_password
:
'请输入密码'
,
input_ou
:
'请输入用户OU'
,
input_filter
:
'请输入用户过滤器'
,
input_mapping
:
'请输入LDAP属性映射'
,
input_username
:
'请输入用户名'
,
input_url_placeholder
:
'请输入LDAP地址 (如 ldap://localhost:389)'
,
input_ou_placeholder
:
'输入用户OU (使用|分隔各OU)'
,
input_filter_placeholder
:
'输入过滤器 [可能的选项是cn或uid或sAMAccountName={0}, 如:(uid={0})]'
,
input_mapping_placeholder
:
'如:{"username":"uid","name":"sn","email":"mail"}, username映射的选项可能是cn或uid或sAMAccountName'
,
test_connect
:
'测试连接'
,
test_login
:
'测试登录'
,
edit
:
'编辑'
,
login_success
:
'登录成功'
,
url_cannot_be_empty
:
'LDAP 地址不能为空'
,
dn_cannot_be_empty
:
'LDAP DN不能为空'
,
ou_cannot_be_empty
:
'LDAP OU不能为空'
,
filter_cannot_be_empty
:
'LDAP 用户过滤器不能为空'
,
mapping_cannot_be_empty
:
'LDAP 用户属性映射不能为空'
,
password_cannot_be_empty
:
'LDAP 密码不能为空'
},
},
role
:
{
role
:
{
menu_authorization
:
'菜单授权'
,
menu_authorization
:
'菜单授权'
,
...
...
frontend/src/views/system/settings/index.vue
0 → 100644
浏览文件 @
b7bcdd1f
<
template
>
<router-view
/>
</
template
>
<
script
>
export
default
({
data
()
{
return
{
}
},
created
()
{
this
.
$store
.
dispatch
(
'app/toggleSideBarHide'
,
false
)
},
method
:
{
}
})
</
script
>
frontend/src/views/system/settings/sso/index.vue
0 → 100644
浏览文件 @
b7bcdd1f
<
template
>
<h2>
this is sso page
</h2>
</
template
>
<
script
>
export
default
({
data
()
{
return
{
}
},
created
()
{
this
.
$store
.
dispatch
(
'app/toggleSideBarHide'
,
false
)
},
method
:
{
}
})
</
script
>
frontend/src/views/system/settings/sso/ldap/index.vue
0 → 100644
浏览文件 @
b7bcdd1f
frontend/src/views/system/settings/sso/oidc/index.vue
0 → 100644
浏览文件 @
b7bcdd1f
frontend/src/views/system/settings/theme/index.vue
0 → 100644
浏览文件 @
b7bcdd1f
<
template
>
<h2>
this is display settings page
</h2>
</
template
>
<
script
>
export
default
{
}
</
script
>
frontend/src/views/system/user/imp-ldap.vue
0 → 100644
浏览文件 @
b7bcdd1f
<
template
>
<layout-content
:header=
"$t('user.import_ldap') "
back-name=
"system-user"
>
<el-form
ref=
"importUserForm"
:model=
"form"
:rules=
"rule"
size=
"small"
label-width=
"auto"
label-position=
"right"
>
<el-form-item
:label=
"$t('commons.organization')"
prop=
"deptId"
>
<treeselect
ref=
"deptTreeSelect"
v-model=
"form.deptId"
:options=
"depts"
:load-options=
"loadDepts"
:auto-load-root-options=
"false"
:placeholder=
"$t('user.choose_org')"
@
open=
"filterData"
/>
</el-form-item>
<el-form-item
:label=
"$t('commons.role')"
prop=
"roleIds"
>
<el-select
ref=
"roleSelect"
v-model=
"form.roleIds"
filterable
style=
"width: 100%"
multiple
:placeholder=
"$t('commons.please_select')"
@
remove-tag=
"deleteTag"
@
change=
"changeRole"
>
<el-option
v-for=
"item in roles"
:key=
"item.name"
:label=
"item.name"
:value=
"item.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"save"
>
{{
$t
(
'commons.confirm'
)
}}
</el-button>
<el-button
@
click=
"cancel"
>
{{
$t
(
'commons.cancel'
)
}}
</el-button>
</el-form-item>
</el-form>
</layout-content>
</
template
>
<
script
>
import
LayoutContent
from
'@/components/business/LayoutContent'
import
{
getDeptTree
,
treeByDeptId
}
from
'@/api/system/dept'
import
{
addUser
,
allRoles
}
from
'@/api/system/user'
export
default
{
components
:
{
LayoutContent
},
data
()
{
return
{
form
:
{
roles
:
[{
id
:
''
}]
},
rule
:
{
roleIds
:
[{
required
:
true
,
message
:
this
.
$t
(
'user.input_roles'
),
trigger
:
'change'
}],
deptId
:
[],
enable
:
[]
},
defaultForm
:
{
enabled
:
1
,
deptId
:
null
,
roleIds
:
[
2
]
},
depts
:
null
,
roles
:
[],
roleDatas
:
[],
userRoles
:
[]
}
},
created
()
{
this
.
initRoles
()
},
mounted
()
{
this
.
bindKey
()
},
destroyed
()
{
this
.
unBindKey
()
},
methods
:
{
entryKey
(
event
)
{
const
keyCode
=
event
.
keyCode
if
(
keyCode
===
13
)
{
this
.
save
()
}
},
bindKey
()
{
document
.
addEventListener
(
'keypress'
,
this
.
entryKey
)
},
unBindKey
()
{
document
.
removeEventListener
(
'keypress'
,
this
.
entryKey
)
},
create
()
{
this
.
depts
=
null
this
.
form
=
Object
.
assign
({},
this
.
defaultForm
)
},
initRoles
()
{
allRoles
().
then
(
res
=>
{
this
.
roles
=
res
.
data
})
},
// 获取弹窗内部门数据
loadDepts
({
action
,
parentNode
,
callback
})
{
if
(
action
===
'LOAD_ROOT_OPTIONS'
&&
!
this
.
form
.
deptId
)
{
const
_self
=
this
treeByDeptId
(
0
).
then
(
res
=>
{
const
results
=
res
.
data
.
map
(
node
=>
{
if
(
node
.
hasChildren
&&
!
node
.
children
)
{
node
.
children
=
null
}
return
node
})
_self
.
depts
=
results
callback
()
})
}
if
(
action
===
'LOAD_CHILDREN_OPTIONS'
)
{
const
_self
=
this
getDeptTree
(
parentNode
.
id
).
then
(
res
=>
{
parentNode
.
children
=
res
.
data
.
map
(
function
(
obj
)
{
return
_self
.
normalizer
(
obj
)
})
callback
()
})
}
},
normalizer
(
node
)
{
if
(
node
.
hasChildren
)
{
node
.
children
=
null
}
return
{
id
:
node
.
deptId
,
label
:
node
.
name
,
children
:
node
.
children
}
},
deleteTag
(
value
)
{
this
.
userRoles
.
forEach
(
function
(
data
,
index
)
{
if
(
data
.
id
===
value
)
{
this
.
userRoles
.
splice
(
index
,
value
)
}
}.
bind
(
this
))
},
changeRole
(
value
)
{
this
.
userRoles
=
[]
value
.
forEach
(
function
(
data
,
index
)
{
const
role
=
{
id
:
data
}
this
.
userRoles
.
push
(
role
)
}.
bind
(
this
))
},
cancel
()
{
this
.
$refs
.
importUserForm
.
resetFields
()
},
save
()
{
this
.
$refs
.
importUserForm
.
validate
(
valid
=>
{
if
(
valid
)
{
const
method
=
addUser
method
(
this
.
form
).
then
(
res
=>
{
this
.
$success
(
this
.
$t
(
'commons.save_success'
))
this
.
backToList
()
})
}
else
{
return
false
}
})
},
backToList
()
{
this
.
$router
.
push
({
name
:
'system-user'
})
},
filterData
(
instanceId
)
{
this
.
$refs
.
roleSelect
&&
this
.
$refs
.
roleSelect
.
blur
&&
this
.
$refs
.
roleSelect
.
blur
()
if
(
!
this
.
depts
)
{
return
}
const
results
=
this
.
depts
.
map
(
node
=>
{
if
(
node
.
hasChildren
)
{
node
.
children
=
null
}
return
node
})
this
.
depts
=
results
}
}
}
</
script
>
frontend/src/views/system/user/index.vue
浏览文件 @
b7bcdd1f
...
@@ -12,6 +12,9 @@
...
@@ -12,6 +12,9 @@
>
>
<template
#
toolbar
>
<template
#
toolbar
>
<el-button
v-permission=
"['user:add']"
icon=
"el-icon-circle-plus-outline"
@
click=
"create"
>
{{
$t
(
'user.create'
)
}}
</el-button>
<el-button
v-permission=
"['user:add']"
icon=
"el-icon-circle-plus-outline"
@
click=
"create"
>
{{
$t
(
'user.create'
)
}}
</el-button>
<!--
<el-button
v-permission=
"['user:import']"
icon=
"el-icon-download"
@
click=
"importLdap"
>
{{
$t
(
'user.import_ldap'
)
}}
</el-button>
-->
<el-button
icon=
"el-icon-download"
@
click=
"importLdap"
>
{{
$t
(
'user.import_ldap'
)
}}
</el-button>
</
template
>
</
template
>
<el-table-column
prop=
"username"
label=
"ID"
/>
<el-table-column
prop=
"username"
label=
"ID"
/>
...
@@ -479,6 +482,9 @@ export default {
...
@@ -479,6 +482,9 @@ export default {
},
},
btnDisabled
(
row
)
{
btnDisabled
(
row
)
{
return
row
.
userId
===
1
return
row
.
userId
===
1
},
importLdap
()
{
this
.
$router
.
push
({
name
:
'system-user-import'
})
}
}
}
}
}
}
...
...
pom.xml
浏览文件 @
b7bcdd1f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
io.dataease
</groupId>
<groupId>
io.dataease
</groupId>
<artifactId>
dataease-server
</artifactId>
<artifactId>
dataease-server
</artifactId>
<version>
1.
2
.0
</version>
<version>
1.
3
.0
</version>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
<parent>
<parent>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论