Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
81a84a54
提交
81a84a54
authored
8月 17, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor:去除无用代码
上级
24ed0bae
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
0 行增加
和
332 行删除
+0
-332
ExtBaseMapper.java
.../main/java/io/dataease/base/mapper/ext/ExtBaseMapper.java
+0
-4
ExtBaseMapper.xml
...c/main/java/io/dataease/base/mapper/ext/ExtBaseMapper.xml
+0
-59
FileUtils.java
...nd/src/main/java/io/dataease/commons/utils/FileUtils.java
+0
-34
index.scss
frontend/src/styles/index.scss
+0
-1
LdapSetting.vue
...tend/src/views/system/systemParamSettings/LdapSetting.vue
+0
-234
没有找到文件。
backend/src/main/java/io/dataease/base/mapper/ext/ExtBaseMapper.java
deleted
100644 → 0
浏览文件 @
24ed0bae
package
io
.
dataease
.
base
.
mapper
.
ext
;
public
interface
ExtBaseMapper
{
}
backend/src/main/java/io/dataease/base/mapper/ext/ExtBaseMapper.xml
deleted
100644 → 0
浏览文件 @
24ed0bae
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"io.dataease.base.mapper.ext.ExtBaseMapper"
>
<sql
id=
"orders"
>
<if
test=
"request.orders != null and request.orders.size() > 0"
>
order by
<foreach
collection=
"request.orders"
separator=
","
item=
"order"
>
${order.name} ${order.type}
</foreach>
</if>
</sql>
<sql
id=
"condition"
>
<choose>
<when
test=
'${object}.operator == "like"'
>
like CONCAT('%', #{${object}.value},'%')
</when>
<when
test=
'${object}.operator == "not like"'
>
not like CONCAT('%', #{${object}.value},'%')
</when>
<when
test=
'${object}.operator == "in"'
>
in
<foreach
collection=
"${object}.value"
item=
"v"
separator=
","
open=
"("
close=
")"
>
#{v}
</foreach>
</when>
<when
test=
'${object}.operator == "not in"'
>
not in
<foreach
collection=
"${object}.value"
item=
"v"
separator=
","
open=
"("
close=
")"
>
#{v}
</foreach>
</when>
<when
test=
'${object}.operator == "between"'
>
between #{${object}.value[0]} and #{${object}.value[1]}
</when>
<when
test=
'${object}.operator == "gt"'
>
>
#{${object}.value}
</when>
<when
test=
'${object}.operator == "lt"'
>
<
#{${object}.value}
</when>
<when
test=
'${object}.operator == "ge"'
>
>
= #{${object}.value}
</when>
<when
test=
'${object}.operator == "le"'
>
<
= #{${object}.value}
</when>
<when
test=
'${object}.operator == "current user"'
>
= '${@io.metersphere.commons.utils.SessionUtils@getUserId()}'
</when>
<otherwise>
= #{${object}.value}
</otherwise>
</choose>
</sql>
</mapper>
backend/src/main/java/io/dataease/commons/utils/FileUtils.java
deleted
100644 → 0
浏览文件 @
24ed0bae
package
io
.
dataease
.
commons
.
utils
;
import
io.dataease.commons.exception.DEException
;
import
io.dataease.i18n.Translator
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.aspectj.util.FileUtil
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.*
;
import
java.util.List
;
public
class
FileUtils
{
private
static
final
String
BODY_FILE_DIR
=
"/opt/metersphere/data/body"
;
public
static
void
createBodyFiles
(
List
<
String
>
bodyUploadIds
,
List
<
MultipartFile
>
bodyFiles
)
{
if
(
CollectionUtils
.
isNotEmpty
(
bodyUploadIds
)
&&
CollectionUtils
.
isNotEmpty
(
bodyFiles
))
{
File
testDir
=
new
File
(
BODY_FILE_DIR
);
if
(!
testDir
.
exists
())
{
testDir
.
mkdirs
();
}
for
(
int
i
=
0
;
i
<
bodyUploadIds
.
size
();
i
++)
{
MultipartFile
item
=
bodyFiles
.
get
(
i
);
File
file
=
new
File
(
BODY_FILE_DIR
+
"/"
+
bodyUploadIds
.
get
(
i
)
+
"_"
+
item
.
getOriginalFilename
());
try
(
InputStream
in
=
item
.
getInputStream
();
OutputStream
out
=
new
FileOutputStream
(
file
))
{
file
.
createNewFile
();
FileUtil
.
copyStream
(
in
,
out
);
}
catch
(
IOException
e
)
{
LogUtil
.
error
(
e
);
DEException
.
throwException
(
Translator
.
get
(
"upload_fail"
));
}
}
}
}
}
frontend/src/styles/index.scss
浏览文件 @
81a84a54
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
@import
'~umy-ui/lib/theme-chalk/index.css'
;
@import
'~umy-ui/lib/theme-chalk/index.css'
;
// 引入样式
// 引入样式
@import
'./deicon/iconfont.css'
;
@import
'./deicon/iconfont.css'
;
// @import '../metersphere/common/css/index.css';
body
{
body
{
...
...
frontend/src/views/system/systemParamSettings/LdapSetting.vue
deleted
100644 → 0
浏览文件 @
24ed0bae
<
template
>
<div
v-loading=
"result.loading"
>
<el-form
ref=
"form"
:model=
"form"
size=
"small"
:rules=
"rules"
:disabled=
"show"
>
<el-form-item
:label=
"$t('ldap.url')"
prop=
"url"
>
<el-input
v-model=
"form.url"
:placeholder=
"$t('ldap.input_url_placeholder')"
/>
</el-form-item>
<el-form-item
:label=
"$t('ldap.dn')"
prop=
"dn"
>
<el-input
v-model=
"form.dn"
:placeholder=
"$t('ldap.input_dn')"
/>
</el-form-item>
<el-form-item
:label=
"$t('ldap.password')"
prop=
"password"
>
<el-input
v-model=
"form.password"
:placeholder=
"$t('ldap.input_password')"
show-password
auto-complete=
"new-password"
/>
</el-form-item>
<el-form-item
:label=
"$t('ldap.ou')"
prop=
"ou"
>
<el-input
v-model=
"form.ou"
:placeholder=
"$t('ldap.input_ou_placeholder')"
/>
</el-form-item>
<el-form-item
:label=
"$t('ldap.filter')"
prop=
"filter"
>
<el-input
v-model=
"form.filter"
:placeholder=
"$t('ldap.input_filter_placeholder')"
/>
</el-form-item>
<el-form-item
:label=
"$t('ldap.mapping')"
prop=
"mapping"
>
<el-input
v-model=
"form.mapping"
:placeholder=
"$t('ldap.input_mapping_placeholder')"
/>
</el-form-item>
<el-form-item
:label=
"$t('ldap.open')"
prop=
"open"
>
<el-checkbox
v-model=
"form.open"
/>
</el-form-item>
</el-form>
<div>
<el-button
type=
"primary"
size=
"small"
:disabled=
"!show"
@
click=
"testConnection"
>
{{
$t
(
'ldap.test_connect'
)
}}
</el-button>
<el-button
type=
"primary"
size=
"small"
:disabled=
"!showLogin || !show"
@
click=
"testLogin"
>
{{
$t
(
'ldap.test_login'
)
}}
</el-button>
<el-button
v-if=
"showEdit"
size=
"small"
@
click=
"edit"
>
{{
$t
(
'ldap.edit'
)
}}
</el-button>
<el-button
v-if=
"showSave"
type=
"success"
size=
"small"
@
click=
"save('form')"
>
{{
$t
(
'commons.save'
)
}}
</el-button>
<el-button
v-if=
"showCancel"
type=
"info"
size=
"small"
@
click=
"cancel"
>
{{
$t
(
'commons.cancel'
)
}}
</el-button>
</div>
<el-dialog
v-loading=
"result.loading"
:title=
"$t('ldap.test_login')"
:visible
.
sync=
"loginVisible"
width=
"30%"
destroy-on-close
@
close=
"close"
>
<el-form
ref=
"loginForm"
:model=
"loginForm"
:rules=
"loginFormRules"
label-width=
"90px"
>
<el-form-item
:label=
"$t('commons.username')"
prop=
"username"
>
<el-input
v-model=
"loginForm.username"
autocomplete=
"off"
:placeholder=
"$t('ldap.input_username')"
/>
</el-form-item>
<el-form-item
:label=
"$t('commons.password')"
prop=
"password"
>
<el-input
v-model=
"loginForm.password"
autocomplete=
"new-password"
:placeholder=
"$t('ldap.input_password')"
show-password
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"text"
@
click=
"loginVisible = false"
>
{{
$t
(
'commons.cancel'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"login('loginForm')"
>
确认
</el-button>
</div>
</el-dialog>
</div>
</
template
>
<
script
>
// import MsDialogFooter from '@/metersphere/common/components/MsDialogFooter'
// import { listenGoBack, removeGoBackListener } from '@/metersphere/common/js/utils'
export
default
{
name
:
'LdapSetting'
,
components
:
{
},
data
()
{
return
{
form
:
{
open
:
false
},
loginForm
:
{},
result
:
{},
show
:
true
,
showEdit
:
true
,
showSave
:
false
,
showCancel
:
false
,
showLogin
:
false
,
loginVisible
:
false
,
rules
:
{
url
:
{
required
:
true
,
message
:
this
.
$t
(
'ldap.input_url'
),
trigger
:
[
'change'
,
'blur'
]
},
dn
:
{
required
:
true
,
message
:
this
.
$t
(
'ldap.input_dn'
),
trigger
:
[
'change'
,
'blur'
]
},
password
:
{
required
:
true
,
message
:
this
.
$t
(
'ldap.input_password'
),
trigger
:
[
'change'
,
'blur'
]
},
ou
:
{
required
:
true
,
message
:
this
.
$t
(
'ldap.input_ou'
),
trigger
:
[
'change'
,
'blur'
]
},
filter
:
{
required
:
true
,
message
:
this
.
$t
(
'ldap.input_filter'
),
trigger
:
[
'change'
,
'blur'
]
},
mapping
:
{
required
:
true
,
message
:
this
.
$t
(
'ldap.input_mapping'
),
trigger
:
[
'change'
,
'blur'
]
}
},
loginFormRules
:
{
username
:
{
required
:
true
,
message
:
this
.
$t
(
'ldap.input_username'
),
trigger
:
'blur'
},
password
:
{
required
:
true
,
message
:
this
.
$t
(
'ldap.input_password'
),
trigger
:
'blur'
}
}
}
},
created
()
{
this
.
init
()
},
methods
:
{
init
()
{
this
.
result
=
this
.
$get
(
'/system/ldap/info'
,
response
=>
{
this
.
form
=
response
.
data
this
.
form
.
open
=
this
.
form
.
open
===
'true'
this
.
$nextTick
(()
=>
{
this
.
$refs
.
form
.
clearValidate
()
})
})
},
edit
()
{
this
.
show
=
false
this
.
showEdit
=
false
this
.
showSave
=
true
this
.
showCancel
=
true
},
cancel
()
{
this
.
showEdit
=
true
this
.
showCancel
=
false
this
.
showSave
=
false
this
.
show
=
true
this
.
init
()
},
close
()
{
this
.
loginVisible
=
false
},
testConnection
()
{
if
(
!
this
.
checkParam
())
{
return
false
}
this
.
result
=
this
.
$post
(
'/ldap/test/connect'
,
this
.
form
,
()
=>
{
this
.
$success
(
this
.
$t
(
'commons.connection_successful'
))
this
.
showLogin
=
true
},
()
=>
{
this
.
showLogin
=
false
})
},
testLogin
()
{
if
(
!
this
.
checkParam
())
{
return
false
}
if
(
!
this
.
form
.
ou
)
{
this
.
$warning
(
this
.
$t
(
'ldap.ou_cannot_be_empty'
))
return
false
}
if
(
!
this
.
form
.
filter
)
{
this
.
$warning
(
this
.
$t
(
'ldap.filter_cannot_be_empty'
))
return
false
}
if
(
!
this
.
form
.
mapping
)
{
this
.
$warning
(
this
.
$t
(
'ldap.mapping_cannot_be_empty'
))
return
false
}
this
.
loginForm
=
{}
this
.
loginVisible
=
true
},
checkParam
()
{
if
(
!
this
.
form
.
url
)
{
this
.
$warning
(
this
.
$t
(
'ldap.url_cannot_be_empty'
))
return
false
}
if
(
!
this
.
form
.
dn
)
{
this
.
$warning
(
this
.
$t
(
'ldap.dn_cannot_be_empty'
))
return
false
}
if
(
!
this
.
form
.
password
)
{
this
.
$warning
(
this
.
$t
(
'ldap.password_cannot_be_empty'
))
return
false
}
return
true
},
save
(
form
)
{
const
param
=
[
{
paramKey
:
'ldap.url'
,
paramValue
:
this
.
form
.
url
,
type
:
'text'
,
sort
:
1
},
{
paramKey
:
'ldap.dn'
,
paramValue
:
this
.
form
.
dn
,
type
:
'text'
,
sort
:
2
},
{
paramKey
:
'ldap.password'
,
paramValue
:
this
.
form
.
password
,
type
:
'password'
,
sort
:
3
},
{
paramKey
:
'ldap.ou'
,
paramValue
:
this
.
form
.
ou
,
type
:
'text'
,
sort
:
4
},
{
paramKey
:
'ldap.filter'
,
paramValue
:
this
.
form
.
filter
,
type
:
'text'
,
sort
:
5
},
{
paramKey
:
'ldap.mapping'
,
paramValue
:
this
.
form
.
mapping
,
type
:
'text'
,
sort
:
6
},
{
paramKey
:
'ldap.open'
,
paramValue
:
this
.
form
.
open
,
type
:
'text'
,
sort
:
7
}
]
this
.
$refs
[
form
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
result
=
this
.
$post
(
'/system/save/ldap'
,
param
,
()
=>
{
this
.
show
=
true
this
.
showEdit
=
true
this
.
showSave
=
false
this
.
showCancel
=
false
this
.
showLogin
=
false
this
.
$success
(
this
.
$t
(
'commons.save_success'
))
this
.
init
()
})
}
else
{
return
false
}
})
},
login
(
form
)
{
this
.
$refs
[
form
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
result
=
this
.
$post
(
'/ldap/test/login'
,
this
.
loginForm
,
()
=>
{
this
.
$success
(
this
.
$t
(
'ldap.login_success'
))
})
}
else
{
return
false
}
})
}
}
}
</
script
>
<
style
scoped
>
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论