Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
d3952387
提交
d3952387
authored
10月 21, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 增加邮件配置
上级
ccc539f5
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
185 行增加
和
110 行删除
+185
-110
pom.xml
backend/pom.xml
+2
-2
AuthApi.java
backend/src/main/java/io/dataease/auth/api/AuthApi.java
+6
-0
AuthServer.java
...end/src/main/java/io/dataease/auth/server/AuthServer.java
+9
-0
AuthUserService.java
...c/main/java/io/dataease/auth/service/AuthUserService.java
+2
-0
AuthUserServiceImpl.java
...va/io/dataease/auth/service/impl/AuthUserServiceImpl.java
+12
-0
SystemParameterController.java
...io/dataease/controller/sys/SystemParameterController.java
+7
-0
MailInfo.java
...in/java/io/dataease/controller/sys/response/MailInfo.java
+18
-0
SystemParameterService.java
...va/io/dataease/service/system/SystemParameterService.java
+30
-2
V27__de1.4.sql
backend/src/main/resources/db/migration/V27__de1.4.sql
+5
-0
email.js
frontend/src/api/system/email.js
+30
-0
user.js
frontend/src/api/user.js
+7
-0
EmailSetting.vue
frontend/src/views/system/SysParam/EmailSetting.vue
+6
-8
index.vue
frontend/src/views/system/SysParam/index.vue
+50
-0
index.vue
frontend/src/views/system/settings/index.vue
+0
-21
index.vue
frontend/src/views/system/settings/sso/index.vue
+0
-21
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
+0
-10
UiSetting.vue
frontend/src/views/system/systemParamSettings/UiSetting.vue
+0
-0
index.vue
frontend/src/views/system/systemParamSettings/index.vue
+0
-45
pom.xml
pom.xml
+1
-1
没有找到文件。
backend/pom.xml
浏览文件 @
d3952387
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
dataease-server
</artifactId>
<groupId>
io.dataease
</groupId>
<version>
1.
3
.0
</version>
<version>
1.
4
.0
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -201,7 +201,7 @@
<dependency>
<groupId>
io.dataease
</groupId>
<artifactId>
dataease-plugin-interface
</artifactId>
<version>
1.
3
</version>
<version>
1.
4
</version>
</dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
...
...
backend/src/main/java/io/dataease/auth/api/AuthApi.java
浏览文件 @
d3952387
...
...
@@ -5,6 +5,8 @@ import io.dataease.auth.api.dto.CurrentUserDto;
import
io.dataease.auth.api.dto.LoginDto
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
springfox.documentation.annotations.ApiIgnore
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -49,4 +51,8 @@ public interface AuthApi {
@PostMapping
(
"/isOpenOidc"
)
boolean
isOpenOidc
();
@ApiIgnore
@PostMapping
(
"/isPluginLoaded"
)
boolean
isPluginLoaded
();
}
backend/src/main/java/io/dataease/auth/server/AuthServer.java
浏览文件 @
d3952387
...
...
@@ -184,6 +184,15 @@ public class AuthServer implements AuthApi {
return
authUserService
.
supportOidc
();
}
@Override
public
boolean
isPluginLoaded
()
{
Boolean
licValid
=
PluginUtils
.
licValid
();
if
(!
licValid
)
return
false
;
return
authUserService
.
pluginLoaded
();
}
/*@Override
...
...
backend/src/main/java/io/dataease/auth/service/AuthUserService.java
浏览文件 @
d3952387
...
...
@@ -29,6 +29,8 @@ public interface AuthUserService {
Boolean
supportOidc
();
Boolean
pluginLoaded
();
}
backend/src/main/java/io/dataease/auth/service/impl/AuthUserServiceImpl.java
浏览文件 @
d3952387
...
...
@@ -8,6 +8,7 @@ import io.dataease.base.mapper.ext.AuthMapper;
import
io.dataease.auth.service.AuthUserService
;
import
io.dataease.commons.constants.AuthConstants
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.plugins.common.service.PluginCommonService
;
import
io.dataease.plugins.config.SpringContextUtil
;
import
io.dataease.plugins.xpack.ldap.service.LdapXpackService
;
import
io.dataease.plugins.xpack.oidc.service.OidcXpackService
;
...
...
@@ -137,5 +138,16 @@ public class AuthUserServiceImpl implements AuthUserService {
return
oidcXpackService
.
isSuuportOIDC
();
}
@Override
public
Boolean
pluginLoaded
()
{
Map
<
String
,
PluginCommonService
>
beansOfType
=
SpringContextUtil
.
getApplicationContext
().
getBeansOfType
((
PluginCommonService
.
class
));
if
(
beansOfType
.
keySet
().
size
()
==
0
)
return
false
;
PluginCommonService
pluginCommonService
=
SpringContextUtil
.
getBean
(
PluginCommonService
.
class
);
if
(
ObjectUtils
.
isEmpty
(
pluginCommonService
))
return
false
;
return
pluginCommonService
.
isPluginLoaded
();
}
}
backend/src/main/java/io/dataease/controller/sys/SystemParameterController.java
浏览文件 @
d3952387
...
...
@@ -2,6 +2,7 @@ package io.dataease.controller.sys;
import
io.dataease.base.domain.SystemParameter
;
import
io.dataease.commons.constants.ParamConstants
;
import
io.dataease.controller.sys.response.MailInfo
;
import
io.dataease.dto.SystemParameterDTO
;
import
io.dataease.service.FileService
;
import
io.dataease.service.system.SystemParameterService
;
...
...
@@ -28,6 +29,12 @@ public class SystemParameterController {
@Resource
private
FileService
fileService
;
@GetMapping
(
"/mail/info"
)
public
MailInfo
mailInfo
()
{
return
systemParameterService
.
mailInfo
(
ParamConstants
.
Classify
.
MAIL
.
getValue
());
}
@PostMapping
(
"/edit/email"
)
public
void
editMail
(
@RequestBody
List
<
SystemParameter
>
systemParameter
)
{
systemParameterService
.
editMail
(
systemParameter
);
...
...
backend/src/main/java/io/dataease/controller/sys/response/MailInfo.java
0 → 100644
浏览文件 @
d3952387
package
io
.
dataease
.
controller
.
sys
.
response
;
import
java.io.Serializable
;
import
lombok.Data
;
@Data
public
class
MailInfo
implements
Serializable
{
private
String
host
;
private
String
port
;
private
String
account
;
private
String
password
;
private
String
ssl
;
private
String
tls
;
private
String
recipient
;
}
backend/src/main/java/io/dataease/service/system/SystemParameterService.java
浏览文件 @
d3952387
package
io
.
dataease
.
service
.
system
;
import
com.alibaba.fastjson.JSON
;
import
io.dataease.base.domain.FileMetadata
;
import
io.dataease.base.domain.SystemParameter
;
import
io.dataease.base.domain.SystemParameterExample
;
...
...
@@ -11,6 +10,7 @@ import io.dataease.commons.exception.DEException;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.commons.utils.EncryptUtils
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.controller.sys.response.MailInfo
;
import
io.dataease.dto.SystemParameterDTO
;
import
io.dataease.i18n.Translator
;
import
io.dataease.service.FileService
;
...
...
@@ -47,6 +47,34 @@ public class SystemParameterService {
return
extSystemParameterMapper
.
email
();
}
public
MailInfo
mailInfo
(
String
type
)
{
List
<
SystemParameter
>
paramList
=
this
.
getParamList
(
type
);
MailInfo
mailInfo
=
new
MailInfo
();
if
(!
CollectionUtils
.
isEmpty
(
paramList
))
{
for
(
SystemParameter
param
:
paramList
)
{
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
SERVER
.
getValue
()))
{
mailInfo
.
setHost
(
param
.
getParamValue
());
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
PORT
.
getValue
()))
{
mailInfo
.
setPort
(
param
.
getParamValue
());
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
ACCOUNT
.
getValue
()))
{
mailInfo
.
setAccount
(
param
.
getParamValue
());
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
PASSWORD
.
getValue
()))
{
String
password
=
EncryptUtils
.
aesDecrypt
(
param
.
getParamValue
()).
toString
();
mailInfo
.
setPassword
(
password
);
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
SSL
.
getValue
()))
{
mailInfo
.
setSsl
(
param
.
getParamValue
());
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
TLS
.
getValue
()))
{
mailInfo
.
setTls
(
param
.
getParamValue
());
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
RECIPIENTS
.
getValue
()))
{
mailInfo
.
setRecipient
(
param
.
getParamValue
());
}
}
}
return
mailInfo
;
}
public
String
getSystemLanguage
()
{
String
result
=
StringUtils
.
EMPTY
;
SystemParameterExample
example
=
new
SystemParameterExample
();
...
...
@@ -120,7 +148,7 @@ public class SystemParameterService {
try
{
helper
=
new
MimeMessageHelper
(
mimeMessage
,
true
);
helper
.
setFrom
(
javaMailSender
.
getUsername
());
helper
.
setSubject
(
"
MeterSpher
e测试邮件 "
);
helper
.
setSubject
(
"
DataEas
e测试邮件 "
);
helper
.
setText
(
"这是一封测试邮件,邮件发送成功"
,
true
);
helper
.
setTo
(
recipients
);
javaMailSender
.
send
(
mimeMessage
);
...
...
backend/src/main/resources/db/migration/V27__de1.4.sql
浏览文件 @
d3952387
...
...
@@ -5,3 +5,7 @@ UPDATE `chart_view` SET `render` = 'antv' WHERE `type` = 'liquid';
ALTER
TABLE
`panel_link`
ADD
COLUMN
`over_time`
bigint
(
13
)
NULL
DEFAULT
NULL
COMMENT
'有效截止时间'
AFTER
`pwd`
;
BEGIN
;
INSERT
INTO
`sys_menu`
VALUES
(
6
,
1
,
0
,
1
,
'系统参数'
,
'system-param'
,
'system/SysParam/index'
,
6
,
'sys-tools'
,
'system-param'
,
b
'0'
,
b
'0'
,
b
'0'
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
COMMIT
;
\ No newline at end of file
frontend/src/api/system/email.js
0 → 100644
浏览文件 @
d3952387
import
request
from
'@/utils/request'
export
function
validate
(
data
)
{
return
request
({
url
:
'/system/testConnection'
,
method
:
'post'
,
timeout
:
30000
,
loading
:
true
,
data
})
}
export
function
emailInfo
()
{
return
request
({
url
:
'/system/mail/info'
,
method
:
'get'
,
loading
:
true
})
}
export
function
updateInfo
(
data
)
{
return
request
({
url
:
'/system/edit/email'
,
method
:
'post'
,
loading
:
true
,
data
})
}
frontend/src/api/user.js
浏览文件 @
d3952387
...
...
@@ -64,3 +64,10 @@ export function oidcStatus() {
method
:
'post'
})
}
export
function
pluginLoaded
()
{
return
request
({
url
:
'/api/auth/isPluginLoaded'
,
method
:
'post'
})
}
frontend/src/views/system/
systemParamSettings
/EmailSetting.vue
→
frontend/src/views/system/
SysParam
/EmailSetting.vue
浏览文件 @
d3952387
<
template
>
<div
v-loading=
"result.loading"
>
<div>
<!--邮件表单-->
<el-form
ref=
"formInline"
...
...
@@ -98,7 +98,7 @@
<
script
>
import
{
post
,
get
}
from
'@/api/commonAjax
'
import
{
emailInfo
,
updateInfo
,
validate
}
from
'@/api/system/email
'
export
default
{
name
:
'EmailSetting'
,
...
...
@@ -107,7 +107,6 @@ export default {
formInline
:
{},
input
:
''
,
visible
:
true
,
result
:
{},
showEdit
:
true
,
showSave
:
false
,
showCancel
:
false
,
...
...
@@ -148,11 +147,10 @@ export default {
this
.
$refs
.
input
=
'password'
},
query
()
{
this
.
result
=
get
(
'/system/mail/info'
,
response
=>
{
emailInfo
().
then
(
response
=>
{
this
.
formInline
=
response
.
data
this
.
formInline
.
ssl
=
this
.
formInline
.
ssl
===
'true'
this
.
formInline
.
tls
=
this
.
formInline
.
tls
===
'true'
// console.log(this.formInline)
this
.
$nextTick
(()
=>
{
this
.
$refs
.
formInline
.
clearValidate
()
})
...
...
@@ -179,7 +177,7 @@ export default {
}
this
.
$refs
[
formInline
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
result
=
post
(
'/system/testConnection'
,
param
,
response
=>
{
validate
(
param
).
then
(
response
=>
{
this
.
$success
(
this
.
$t
(
'commons.connection_successful'
))
})
}
else
{
...
...
@@ -211,7 +209,7 @@ export default {
this
.
$refs
[
formInline
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
result
=
post
(
'/system/edit/email'
,
param
,
response
=>
{
updateInfo
(
param
).
then
(
response
=>
{
const
flag
=
response
.
success
if
(
flag
)
{
this
.
$success
(
this
.
$t
(
'commons.save_success'
))
...
...
@@ -220,7 +218,7 @@ export default {
}
})
}
else
{
return
false
// this.result =
false
}
})
},
...
...
frontend/src/views/system/SysParam/index.vue
0 → 100644
浏览文件 @
d3952387
<
template
>
<layout-content
v-loading=
"$store.getters.loadingMap[$store.getters.currentPath]"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tab-pane
:lazy=
"true"
:label=
"$t('system_parameter_setting.mailbox_service_settings')"
name=
"first"
>
<email-setting
/>
</el-tab-pane>
<el-tab-pane
v-if=
"isPluginLoaded"
:lazy=
"true"
:label=
"$t('sysParams.display')"
name=
"second"
>
<plugin-com
v-if=
"isPluginLoaded"
ref=
"DisplaySetting"
component-name=
"DisplaySetting"
/>
</el-tab-pane>
<el-tab-pane
v-if=
"isPluginLoaded"
:lazy=
"true"
:label=
"$t('sysParams.ldap')"
name=
"third"
>
<plugin-com
v-if=
"isPluginLoaded"
ref=
"DisplaySetting"
component-name=
"LdapSetting"
/>
</el-tab-pane>
<el-tab-pane
v-if=
"isPluginLoaded"
:lazy=
"true"
:label=
"$t('sysParams.oidc')"
name=
"fourth"
>
<plugin-com
v-if=
"isPluginLoaded"
ref=
"DisplaySetting"
component-name=
"SsoSetting"
/>
</el-tab-pane>
</el-tabs>
</layout-content>
</
template
>
<
script
>
import
EmailSetting
from
'./EmailSetting'
import
LayoutContent
from
'@/components/business/LayoutContent'
import
PluginCom
from
'@/views/system/plugin/PluginCom'
import
{
pluginLoaded
}
from
'@/api/user'
export
default
{
components
:
{
EmailSetting
,
LayoutContent
,
PluginCom
},
data
()
{
return
{
activeName
:
'first'
,
isPluginLoaded
:
false
}
},
beforeCreate
()
{
pluginLoaded
().
then
(
res
=>
{
this
.
isPluginLoaded
=
res
.
success
&&
res
.
data
})
},
methods
:
{
handleClick
(
tab
,
event
)
{
console
.
log
(
tab
,
event
)
}
}
}
</
script
>
frontend/src/views/system/settings/index.vue
deleted
100644 → 0
浏览文件 @
ccc539f5
<
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
deleted
100644 → 0
浏览文件 @
ccc539f5
<
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
deleted
100644 → 0
浏览文件 @
ccc539f5
frontend/src/views/system/settings/sso/oidc/index.vue
deleted
100644 → 0
浏览文件 @
ccc539f5
frontend/src/views/system/settings/theme/index.vue
deleted
100644 → 0
浏览文件 @
ccc539f5
<
template
>
<h2>
this is display settings page
</h2>
</
template
>
<
script
>
export
default
{
}
</
script
>
frontend/src/views/system/systemParamSettings/UiSetting.vue
deleted
100644 → 0
浏览文件 @
ccc539f5
差异被折叠。
点击展开。
frontend/src/views/system/systemParamSettings/index.vue
deleted
100644 → 0
浏览文件 @
ccc539f5
<
template
>
<el-card>
<ui-setting
v-if=
"!test"
/>
<!--
<el-tabs
v-model=
"activeName"
class=
"system-setting"
>
<el-tab-pane
label=
"显示设置"
name=
"ui"
>
<ui-setting
/>
</el-tab-pane>
<el-tab-pane
:label=
"$t('system_parameter_setting.mailbox_service_settings')"
name=
"email"
>
<email-setting
/>
</el-tab-pane>
</el-tabs>
-->
<async-component
v-if=
"test"
url=
"http://localhost:8081/PluginDemo.js"
@
execute-axios=
"executeAxios"
/>
</el-card>
</
template
>
<
script
>
import
UiSetting
from
'./UiSetting'
import
AsyncComponent
from
'@/components/AsyncComponent'
export
default
{
name
:
'SystemParameterSetting'
,
components
:
{
UiSetting
,
AsyncComponent
// 'MsDisplay': display.default,
// 'MsAuth': auth.default
},
data
()
{
return
{
activeName
:
'ui'
,
test
:
false
}
},
methods
:
{
// hasLicense
executeAxios
(
options
)
{
// console.log(options)
}
}
}
</
script
>
<
style
scoped
>
</
style
>
pom.xml
浏览文件 @
d3952387
...
...
@@ -4,7 +4,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
io.dataease
</groupId>
<artifactId>
dataease-server
</artifactId>
<version>
1.
3
.0
</version>
<version>
1.
4
.0
</version>
<packaging>
pom
</packaging>
<parent>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论