Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
b609955a
提交
b609955a
authored
10月 22, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 增加超时时间配置
上级
49288318
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
357 行增加
和
43 行删除
+357
-43
ShiroServiceImpl.java
.../java/io/dataease/auth/service/impl/ShiroServiceImpl.java
+1
-1
ParamConstants.java
...in/java/io/dataease/commons/constants/ParamConstants.java
+12
-0
SystemParameterController.java
...io/dataease/controller/sys/SystemParameterController.java
+21
-0
BasicInfo.java
...n/java/io/dataease/controller/sys/response/BasicInfo.java
+16
-0
SysMsgService.java
.../main/java/io/dataease/service/message/SysMsgService.java
+11
-2
SystemParameterService.java
...va/io/dataease/service/system/SystemParameterService.java
+36
-0
V27__de1.4.sql
backend/src/main/resources/db/migration/V27__de1.4.sql
+2
-1
App.vue
frontend/src/App.vue
+2
-1
basic.js
frontend/src/api/system/basic.js
+19
-0
en.js
frontend/src/lang/en.js
+5
-0
tw.js
frontend/src/lang/tw.js
+5
-0
zh.js
frontend/src/lang/zh.js
+9
-1
auth.js
frontend/src/utils/auth.js
+5
-0
request.js
frontend/src/utils/request.js
+62
-34
BasicSetting.vue
frontend/src/views/system/SysParam/BasicSetting.vue
+144
-0
index.vue
frontend/src/views/system/SysParam/index.vue
+7
-3
没有找到文件。
backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java
浏览文件 @
b609955a
...
@@ -56,7 +56,7 @@ public class ShiroServiceImpl implements ShiroService {
...
@@ -56,7 +56,7 @@ public class ShiroServiceImpl implements ShiroService {
// filterChainDefinitionMap.put("/axios.map", ANON);
// filterChainDefinitionMap.put("/axios.map", ANON);
filterChainDefinitionMap
.
put
(
"/api/auth/login"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/api/auth/login"
,
ANON
);
// filterChainDefinitionMap.put("/api/auth/logo
ut", ANON);
filterChainDefinitionMap
.
put
(
"/system/requestTimeO
ut"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/api/auth/validateName"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/api/auth/validateName"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/api/auth/isOpenLdap"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/api/auth/isOpenLdap"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/api/auth/isOpenOidc"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/api/auth/isOpenOidc"
,
ANON
);
...
...
backend/src/main/java/io/dataease/commons/constants/ParamConstants.java
浏览文件 @
b609955a
...
@@ -109,6 +109,18 @@ public interface ParamConstants {
...
@@ -109,6 +109,18 @@ public interface ParamConstants {
}
}
}
}
enum
BASIC
implements
ParamConstants
{
FRONT_TIME_OUT
(
"basic.frontTimeOut"
),
MSG_TIME_OUT
(
"basic.msgTimeOut"
);
private
String
value
;
public
String
getValue
()
{
return
this
.
value
;
}
private
BASIC
(
String
value
)
{
this
.
value
=
value
;
}
}
enum
BASE
implements
ParamConstants
{
enum
BASE
implements
ParamConstants
{
URL
(
"base.url"
);
URL
(
"base.url"
);
...
...
backend/src/main/java/io/dataease/controller/sys/SystemParameterController.java
浏览文件 @
b609955a
...
@@ -2,10 +2,13 @@ package io.dataease.controller.sys;
...
@@ -2,10 +2,13 @@ package io.dataease.controller.sys;
import
io.dataease.base.domain.SystemParameter
;
import
io.dataease.base.domain.SystemParameter
;
import
io.dataease.commons.constants.ParamConstants
;
import
io.dataease.commons.constants.ParamConstants
;
import
io.dataease.controller.sys.response.BasicInfo
;
import
io.dataease.controller.sys.response.MailInfo
;
import
io.dataease.controller.sys.response.MailInfo
;
import
io.dataease.dto.SystemParameterDTO
;
import
io.dataease.dto.SystemParameterDTO
;
import
io.dataease.service.FileService
;
import
io.dataease.service.FileService
;
import
io.dataease.service.system.SystemParameterService
;
import
io.dataease.service.system.SystemParameterService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
...
@@ -35,11 +38,27 @@ public class SystemParameterController {
...
@@ -35,11 +38,27 @@ public class SystemParameterController {
return
systemParameterService
.
mailInfo
(
ParamConstants
.
Classify
.
MAIL
.
getValue
());
return
systemParameterService
.
mailInfo
(
ParamConstants
.
Classify
.
MAIL
.
getValue
());
}
}
@GetMapping
(
"/basic/info"
)
public
BasicInfo
basicInfo
()
{
return
systemParameterService
.
basicInfo
();
}
@GetMapping
(
"/requestTimeOut"
)
public
Integer
RequestTimeOut
()
{
BasicInfo
basicInfo
=
systemParameterService
.
basicInfo
();
return
StringUtils
.
isNotBlank
(
basicInfo
.
getFrontTimeOut
())
?
Integer
.
parseInt
(
basicInfo
.
getFrontTimeOut
())
:
10
;
}
@PostMapping
(
"/edit/email"
)
@PostMapping
(
"/edit/email"
)
public
void
editMail
(
@RequestBody
List
<
SystemParameter
>
systemParameter
)
{
public
void
editMail
(
@RequestBody
List
<
SystemParameter
>
systemParameter
)
{
systemParameterService
.
editMail
(
systemParameter
);
systemParameterService
.
editMail
(
systemParameter
);
}
}
@PostMapping
(
"/edit/basic"
)
public
void
editBasic
(
@RequestBody
List
<
SystemParameter
>
systemParameter
)
{
systemParameterService
.
editBasic
(
systemParameter
);
}
@PostMapping
(
"/testConnection"
)
@PostMapping
(
"/testConnection"
)
public
void
testConnection
(
@RequestBody
HashMap
<
String
,
String
>
hashMap
)
{
public
void
testConnection
(
@RequestBody
HashMap
<
String
,
String
>
hashMap
)
{
systemParameterService
.
testConnection
(
hashMap
);
systemParameterService
.
testConnection
(
hashMap
);
...
@@ -77,4 +96,6 @@ public class SystemParameterController {
...
@@ -77,4 +96,6 @@ public class SystemParameterController {
}
}
}
}
backend/src/main/java/io/dataease/controller/sys/response/BasicInfo.java
0 → 100644
浏览文件 @
b609955a
package
io
.
dataease
.
controller
.
sys
.
response
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
BasicInfo
implements
Serializable
{
@ApiModelProperty
(
"请求超时时间"
)
private
String
frontTimeOut
;
@ApiModelProperty
(
"消息保留时间"
)
private
String
msgTimeOut
;
}
backend/src/main/java/io/dataease/service/message/SysMsgService.java
浏览文件 @
b609955a
...
@@ -16,14 +16,16 @@ import io.dataease.controller.sys.request.MsgSettingRequest;
...
@@ -16,14 +16,16 @@ import io.dataease.controller.sys.request.MsgSettingRequest;
import
io.dataease.controller.sys.response.MsgGridDto
;
import
io.dataease.controller.sys.response.MsgGridDto
;
import
io.dataease.controller.sys.response.SettingTreeNode
;
import
io.dataease.controller.sys.response.SettingTreeNode
;
import
io.dataease.controller.sys.response.SubscribeNode
;
import
io.dataease.controller.sys.response.SubscribeNode
;
import
io.dataease.service.system.SystemParameterService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -31,7 +33,7 @@ import java.util.stream.Collectors;
...
@@ -31,7 +33,7 @@ import java.util.stream.Collectors;
@Service
@Service
public
class
SysMsgService
{
public
class
SysMsgService
{
private
static
final
long
overDays
=
30
;
private
static
int
overDays
=
30
;
@Resource
@Resource
private
SysMsgMapper
sysMsgMapper
;
private
SysMsgMapper
sysMsgMapper
;
...
@@ -50,6 +52,9 @@ public class SysMsgService {
...
@@ -50,6 +52,9 @@ public class SysMsgService {
@Resource
@Resource
private
SysMsgSettingMapper
sysMsgSettingMapper
;
private
SysMsgSettingMapper
sysMsgSettingMapper
;
@Autowired
private
SystemParameterService
systemParameterService
;
public
List
<
SysMsg
>
query
(
Long
userId
,
MsgRequest
msgRequest
)
{
public
List
<
SysMsg
>
query
(
Long
userId
,
MsgRequest
msgRequest
)
{
String
orderClause
=
" create_time desc"
;
String
orderClause
=
" create_time desc"
;
SysMsgExample
example
=
new
SysMsgExample
();
SysMsgExample
example
=
new
SysMsgExample
();
...
@@ -330,6 +335,10 @@ public class SysMsgService {
...
@@ -330,6 +335,10 @@ public class SysMsgService {
public
Long
overTime
()
{
public
Long
overTime
()
{
String
msgTimeOut
=
systemParameterService
.
basicInfo
().
getMsgTimeOut
();
if
(
StringUtils
.
isNotBlank
(
msgTimeOut
))
{
overDays
=
Integer
.
parseInt
(
msgTimeOut
);
}
Long
currentTime
=
System
.
currentTimeMillis
();
Long
currentTime
=
System
.
currentTimeMillis
();
long
oneDayTime
=
24
*
60
*
60
*
1000
;
long
oneDayTime
=
24
*
60
*
60
*
1000
;
...
...
backend/src/main/java/io/dataease/service/system/SystemParameterService.java
浏览文件 @
b609955a
...
@@ -10,6 +10,7 @@ import io.dataease.commons.exception.DEException;
...
@@ -10,6 +10,7 @@ import io.dataease.commons.exception.DEException;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.commons.utils.EncryptUtils
;
import
io.dataease.commons.utils.EncryptUtils
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.controller.sys.response.BasicInfo
;
import
io.dataease.controller.sys.response.MailInfo
;
import
io.dataease.controller.sys.response.MailInfo
;
import
io.dataease.dto.SystemParameterDTO
;
import
io.dataease.dto.SystemParameterDTO
;
import
io.dataease.i18n.Translator
;
import
io.dataease.i18n.Translator
;
...
@@ -47,6 +48,24 @@ public class SystemParameterService {
...
@@ -47,6 +48,24 @@ public class SystemParameterService {
return
extSystemParameterMapper
.
email
();
return
extSystemParameterMapper
.
email
();
}
}
public
BasicInfo
basicInfo
()
{
List
<
SystemParameter
>
paramList
=
this
.
getParamList
(
"basic"
);
BasicInfo
result
=
new
BasicInfo
();
if
(!
CollectionUtils
.
isEmpty
(
paramList
))
{
for
(
SystemParameter
param
:
paramList
)
{
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
BASIC
.
FRONT_TIME_OUT
.
getValue
()))
{
/* result.setFrontTimeOut(StringUtils.isBlank(param.getParamValue()) ? 0 : Integer.parseInt(param.getParamValue())); */
result
.
setFrontTimeOut
(
param
.
getParamValue
());
}
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
BASIC
.
MSG_TIME_OUT
.
getValue
()))
{
/* result.setMsgTimeOut(StringUtils.isBlank(param.getParamValue()) ? 0 : Integer.parseInt(param.getParamValue())); */
result
.
setMsgTimeOut
(
param
.
getParamValue
());
}
}
}
return
result
;
}
public
MailInfo
mailInfo
(
String
type
)
{
public
MailInfo
mailInfo
(
String
type
)
{
List
<
SystemParameter
>
paramList
=
this
.
getParamList
(
type
);
List
<
SystemParameter
>
paramList
=
this
.
getParamList
(
type
);
...
@@ -89,6 +108,8 @@ public class SystemParameterService {
...
@@ -89,6 +108,8 @@ public class SystemParameterService {
return
result
;
return
result
;
}
}
public
void
editMail
(
List
<
SystemParameter
>
parameters
)
{
public
void
editMail
(
List
<
SystemParameter
>
parameters
)
{
List
<
SystemParameter
>
paramList
=
this
.
getParamList
(
ParamConstants
.
Classify
.
MAIL
.
getValue
());
List
<
SystemParameter
>
paramList
=
this
.
getParamList
(
ParamConstants
.
Classify
.
MAIL
.
getValue
());
boolean
empty
=
paramList
.
size
()
<=
0
;
boolean
empty
=
paramList
.
size
()
<=
0
;
...
@@ -112,6 +133,21 @@ public class SystemParameterService {
...
@@ -112,6 +133,21 @@ public class SystemParameterService {
});
});
}
}
public
void
editBasic
(
List
<
SystemParameter
>
parameters
)
{
parameters
.
forEach
(
parameter
->
{
SystemParameterExample
example
=
new
SystemParameterExample
();
example
.
createCriteria
().
andParamKeyEqualTo
(
parameter
.
getParamKey
());
if
(
systemParameterMapper
.
countByExample
(
example
)
>
0
)
{
systemParameterMapper
.
updateByPrimaryKey
(
parameter
);
}
else
{
systemParameterMapper
.
insert
(
parameter
);
}
example
.
clear
();
});
}
public
List
<
SystemParameter
>
getParamList
(
String
type
)
{
public
List
<
SystemParameter
>
getParamList
(
String
type
)
{
SystemParameterExample
example
=
new
SystemParameterExample
();
SystemParameterExample
example
=
new
SystemParameterExample
();
example
.
createCriteria
().
andParamKeyLike
(
type
+
"%"
);
example
.
createCriteria
().
andParamKeyLike
(
type
+
"%"
);
...
...
backend/src/main/resources/db/migration/V27__de1.4.sql
浏览文件 @
b609955a
...
@@ -7,5 +7,5 @@ UPDATE `chart_view` SET `render` = 'antv' WHERE `type` = 'liquid';
...
@@ -7,5 +7,5 @@ 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`
;
ALTER
TABLE
`panel_link`
ADD
COLUMN
`over_time`
bigint
(
13
)
NULL
DEFAULT
NULL
COMMENT
'有效截止时间'
AFTER
`pwd`
;
BEGIN
;
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
);
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'
,
'sysparam:read'
,
NULL
,
NULL
,
NULL
,
NULL
);
COMMIT
;
COMMIT
;
\ No newline at end of file
frontend/src/App.vue
浏览文件 @
b609955a
...
@@ -5,11 +5,12 @@
...
@@ -5,11 +5,12 @@
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'App'
,
name
:
'App'
,
beforeCreate
()
{
beforeCreate
()
{
// document.body.className = 'blackTheme'
}
}
}
}
</
script
>
</
script
>
frontend/src/api/system/basic.js
0 → 100644
浏览文件 @
b609955a
import
request
from
'@/utils/request'
export
function
basicInfo
()
{
return
request
({
url
:
'/system/basic/info'
,
method
:
'get'
,
loading
:
true
})
}
export
function
updateInfo
(
data
)
{
return
request
({
url
:
'/system/edit/basic'
,
method
:
'post'
,
loading
:
true
,
data
})
}
frontend/src/lang/en.js
浏览文件 @
b609955a
...
@@ -606,6 +606,11 @@ export default {
...
@@ -606,6 +606,11 @@ export default {
mailbox_service_settings
:
'Mail Settings'
,
mailbox_service_settings
:
'Mail Settings'
,
test_connection
:
'Test connection'
,
test_connection
:
'Test connection'
,
SMTP_host
:
'SMTP Host'
,
SMTP_host
:
'SMTP Host'
,
basic_setting
:
'Basic setting'
,
front_time_out
:
'Request timeOut(unit: second, Attention: Refresh browser takes effect after saving)'
,
msg_time_out
:
'Message retention time(unit: day)'
,
empty_front
:
'If empty then default value is 10s'
,
empty_msg
:
'If empty then default value is 30 days'
,
SMTP_port
:
'SMTP Port'
,
SMTP_port
:
'SMTP Port'
,
SMTP_account
:
'SMTP Account'
,
SMTP_account
:
'SMTP Account'
,
SMTP_password
:
'SMTP Password'
,
SMTP_password
:
'SMTP Password'
,
...
...
frontend/src/lang/tw.js
浏览文件 @
b609955a
...
@@ -608,6 +608,11 @@ export default {
...
@@ -608,6 +608,11 @@ export default {
mailbox_service_settings
:
'郵件設置'
,
mailbox_service_settings
:
'郵件設置'
,
test_connection
:
'測試連接'
,
test_connection
:
'測試連接'
,
SMTP_host
:
'SMTP主機'
,
SMTP_host
:
'SMTP主機'
,
basic_setting
:
'基礎設置'
,
front_time_out
:
'請求超時時間(單位:秒, 注意:保存後刷新瀏覽器生效)'
,
msg_time_out
:
'消息保留時間(單位:天)'
,
empty_front
:
'為空則默認取值10秒'
,
empty_msg
:
'為空則默認取值30天'
,
SMTP_port
:
'SMTP端口'
,
SMTP_port
:
'SMTP端口'
,
SMTP_account
:
'SMTP賬戶'
,
SMTP_account
:
'SMTP賬戶'
,
SMTP_password
:
'SMTP密碼'
,
SMTP_password
:
'SMTP密碼'
,
...
...
frontend/src/lang/zh.js
浏览文件 @
b609955a
...
@@ -608,6 +608,13 @@ export default {
...
@@ -608,6 +608,13 @@ export default {
mailbox_service_settings
:
'邮件设置'
,
mailbox_service_settings
:
'邮件设置'
,
test_connection
:
'测试连接'
,
test_connection
:
'测试连接'
,
SMTP_host
:
'SMTP主机'
,
SMTP_host
:
'SMTP主机'
,
basic_setting
:
'基础设置'
,
front_time_out
:
'请求超时时间(单位:秒, 注意:保存后刷新浏览器生效)'
,
msg_time_out
:
'消息保留时间(单位:天)'
,
empty_front
:
'为空则默认取10秒'
,
empty_msg
:
'为空则默认取30天'
,
front_error
:
'请填写0-100正整数'
,
msg_error
:
'请填写正整数'
,
SMTP_port
:
'SMTP端口'
,
SMTP_port
:
'SMTP端口'
,
SMTP_account
:
'SMTP账户'
,
SMTP_account
:
'SMTP账户'
,
SMTP_password
:
'SMTP密码'
,
SMTP_password
:
'SMTP密码'
,
...
@@ -1500,7 +1507,8 @@ export default {
...
@@ -1500,7 +1507,8 @@ export default {
i18n_msg_type_dataset_sync_faild
:
'数据集同步失败'
,
i18n_msg_type_dataset_sync_faild
:
'数据集同步失败'
,
i18n_msg_type_ds_invalid
:
'数据源失效'
,
i18n_msg_type_ds_invalid
:
'数据源失效'
,
i18n_msg_type_all
:
'全部类型'
,
i18n_msg_type_all
:
'全部类型'
,
channel_inner_msg
:
'站内消息'
channel_inner_msg
:
'站内消息'
,
channel_email_msg
:
'邮件'
},
},
denumberrange
:
{
denumberrange
:
{
label
:
'数值区间'
,
label
:
'数值区间'
,
...
...
frontend/src/utils/auth.js
浏览文件 @
b609955a
...
@@ -48,3 +48,8 @@ export function getSysUI() {
...
@@ -48,3 +48,8 @@ export function getSysUI() {
return
json
?
JSON
.
parse
(
json
)
:
null
return
json
?
JSON
.
parse
(
json
)
:
null
}
}
export
function
getTimeOut
()
{
const
val
=
Cookies
.
get
(
'request-time-out'
)
return
val
}
frontend/src/utils/request.js
浏览文件 @
b609955a
...
@@ -12,11 +12,42 @@ import { getLinkToken, setLinkToken } from '@/utils/auth'
...
@@ -12,11 +12,42 @@ import { getLinkToken, setLinkToken } from '@/utils/auth'
const
TokenKey
=
Config
.
TokenKey
const
TokenKey
=
Config
.
TokenKey
const
RefreshTokenKey
=
Config
.
RefreshTokenKey
const
RefreshTokenKey
=
Config
.
RefreshTokenKey
const
LinkTokenKey
=
Config
.
LinkTokenKey
const
LinkTokenKey
=
Config
.
LinkTokenKey
import
Cookies
from
'js-cookie'
// create an axios instance
// create an axios instance
const
service
=
axios
.
create
({
const
getTimeOut
=
()
=>
{
let
time
=
10
const
url
=
'/system/requestTimeOut'
const
xhr
=
new
XMLHttpRequest
()
xhr
.
onreadystatechange
=
()
=>
{
if
(
xhr
.
readyState
===
4
&&
xhr
.
status
===
200
)
{
if
(
xhr
.
responseText
)
{
try
{
const
response
=
JSON
.
parse
(
xhr
.
responseText
)
if
(
response
.
success
)
{
Cookies
.
set
(
'request-time-out'
,
response
.
data
)
time
=
response
.
data
}
else
{
$error
(
'系统异常,请联系管理员'
)
}
}
catch
(
e
)
{
$error
(
'系统异常,请联系管理员'
)
}
}
else
{
$error
(
'网络异常,请联系网管'
)
}
}
}
xhr
.
open
(
'get'
,
url
,
false
)
xhr
.
send
()
return
time
}
const
time
=
getTimeOut
()
let
service
=
axios
.
create
({
baseURL
:
process
.
env
.
VUE_APP_BASE_API
,
// url = base url + request url
baseURL
:
process
.
env
.
VUE_APP_BASE_API
,
// url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
timeout
:
10000
// request timeout
timeout
:
time
?
time
*
1000
:
10000
})
})
// request interceptor
// request interceptor
...
@@ -60,13 +91,36 @@ service.interceptors.request.use(
...
@@ -60,13 +91,36 @@ service.interceptors.request.use(
}
}
)
)
// const defaultOptions = {
service
.
setTimeOut
=
time
=>
{
// confirmButtonText: i18n.t('login.re_login')
service
=
axios
.
create
({
// }
baseURL
:
process
.
env
.
VUE_APP_BASE_API
,
timeout
:
time
})
}
const
checkAuth
=
response
=>
{
// 请根据实际需求修改
// 请根据实际需求修改
service
.
interceptors
.
response
.
use
(
response
=>
{
response
.
config
.
loading
&&
tryHideLoading
(
store
.
getters
.
currentPath
)
checkAuth
(
response
)
return
response
.
data
},
error
=>
{
const
config
=
error
.
response
&&
error
.
response
.
config
||
error
.
config
const
headers
=
error
.
response
&&
error
.
response
.
headers
||
error
.
response
||
config
.
headers
config
.
loading
&&
tryHideLoading
(
store
.
getters
.
currentPath
)
let
msg
if
(
error
.
response
)
{
checkAuth
(
error
.
response
)
// checkPermission(error.response)
msg
=
error
.
response
.
data
.
message
||
error
.
response
.
data
}
else
{
msg
=
error
.
message
}
!
config
.
hideMsg
&&
(
!
headers
[
'authentication-status'
])
&&
$error
(
msg
)
return
Promise
.
reject
(
error
)
})
const
checkAuth
=
response
=>
{
if
(
response
.
headers
[
'authentication-status'
]
===
'login_expire'
)
{
if
(
response
.
headers
[
'authentication-status'
]
===
'login_expire'
)
{
const
message
=
i18n
.
t
(
'login.expires'
)
const
message
=
i18n
.
t
(
'login.expires'
)
// store.dispatch('user/setLoginMsg', message)
// store.dispatch('user/setLoginMsg', message)
...
@@ -103,31 +157,5 @@ const checkAuth = response => {
...
@@ -103,31 +157,5 @@ const checkAuth = response => {
setLinkToken
(
linkToken
)
setLinkToken
(
linkToken
)
store
.
dispatch
(
'user/setLinkToken'
,
linkToken
)
store
.
dispatch
(
'user/setLinkToken'
,
linkToken
)
}
}
// 许可状态改变 刷新页面
// if (response.headers['lic-status']) {
// location.reload()
// }
}
}
// 请根据实际需求修改
service
.
interceptors
.
response
.
use
(
response
=>
{
response
.
config
.
loading
&&
tryHideLoading
(
store
.
getters
.
currentPath
)
checkAuth
(
response
)
return
response
.
data
},
error
=>
{
const
config
=
error
.
response
&&
error
.
response
.
config
||
error
.
config
const
headers
=
error
.
response
&&
error
.
response
.
headers
||
error
.
response
||
config
.
headers
config
.
loading
&&
tryHideLoading
(
store
.
getters
.
currentPath
)
let
msg
if
(
error
.
response
)
{
checkAuth
(
error
.
response
)
// checkPermission(error.response)
msg
=
error
.
response
.
data
.
message
||
error
.
response
.
data
}
else
{
msg
=
error
.
message
}
!
config
.
hideMsg
&&
(
!
headers
[
'authentication-status'
])
&&
$error
(
msg
)
return
Promise
.
reject
(
error
)
})
export
default
service
export
default
service
frontend/src/views/system/SysParam/BasicSetting.vue
0 → 100644
浏览文件 @
b609955a
<
template
>
<div>
<!--基础配置表单-->
<el-form
ref=
"formInline"
v-loading=
"loading"
:model=
"formInline"
:rules=
"rules"
class=
"demo-form-inline"
:disabled=
"show"
size=
"small"
>
<el-row>
<el-col>
<el-form-item
:label=
"$t('system_parameter_setting.front_time_out')"
prop=
"frontTimeOut"
>
<el-input
v-model=
"formInline.frontTimeOut"
:placeholder=
"$t('system_parameter_setting.empty_front')"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item
:label=
"$t('system_parameter_setting.msg_time_out')"
prop=
"msgTimeOut"
>
<el-input
v-model=
"formInline.msgTimeOut"
:placeholder=
"$t('system_parameter_setting.empty_msg')"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div>
<el-button
v-if=
"showEdit"
size=
"small"
@
click=
"edit"
>
{{
$t
(
'commons.edit'
)
}}
</el-button>
<el-button
v-if=
"showSave"
type=
"success"
:disabled=
"disabledSave"
size=
"small"
@
click=
"save('formInline')"
>
{{
$t
(
'commons.save'
)
}}
</el-button>
<el-button
v-if=
"showCancel"
type=
"info"
size=
"small"
@
click=
"cancel"
>
{{
$t
(
'commons.cancel'
)
}}
</el-button>
</div>
</div>
</
template
>
<
script
>
import
{
basicInfo
,
updateInfo
}
from
'@/api/system/basic'
export
default
{
name
:
'EmailSetting'
,
data
()
{
return
{
formInline
:
{},
input
:
''
,
visible
:
true
,
showEdit
:
true
,
showSave
:
false
,
showCancel
:
false
,
show
:
true
,
disabledSave
:
false
,
loading
:
false
,
rules
:
{
frontTimeOut
:
[
{
pattern
:
'^([0-9]{1,2}|100)$'
,
message
:
this
.
$t
(
'system_parameter_setting.front_error'
),
trigger
:
'blur'
}
],
msgTimeOut
:
[
{
pattern
:
'^[0-9]*$'
,
message
:
this
.
$t
(
'system_parameter_setting.msg_error'
),
trigger
:
'blur'
}
]
}
}
},
created
()
{
this
.
query
()
},
methods
:
{
query
()
{
basicInfo
().
then
(
response
=>
{
this
.
formInline
=
response
.
data
this
.
$nextTick
(()
=>
{
this
.
$refs
.
formInline
.
clearValidate
()
})
})
},
edit
()
{
this
.
showEdit
=
false
this
.
showSave
=
true
this
.
showCancel
=
true
this
.
show
=
false
},
save
(
formInline
)
{
this
.
showEdit
=
true
this
.
showCancel
=
false
this
.
showSave
=
false
this
.
show
=
true
const
param
=
[
{
paramKey
:
'basic.frontTimeOut'
,
paramValue
:
this
.
formInline
.
frontTimeOut
,
type
:
'text'
,
sort
:
1
},
{
paramKey
:
'basic.msgTimeOut'
,
paramValue
:
this
.
formInline
.
msgTimeOut
,
type
:
'text'
,
sort
:
2
}
]
this
.
$refs
[
formInline
].
validate
(
valid
=>
{
if
(
valid
)
{
updateInfo
(
param
).
then
(
response
=>
{
const
flag
=
response
.
success
if
(
flag
)
{
this
.
$success
(
this
.
$t
(
'commons.save_success'
))
window
.
location
.
reload
()
}
else
{
this
.
$message
.
error
(
this
.
$t
(
'commons.save_failed'
))
}
})
}
else
{
// this.result = false
}
})
},
cancel
()
{
this
.
showEdit
=
true
this
.
showCancel
=
false
this
.
showSave
=
false
this
.
show
=
true
this
.
query
()
}
}
}
</
script
>
<
style
scoped
>
</
style
>
frontend/src/views/system/SysParam/index.vue
浏览文件 @
b609955a
...
@@ -2,6 +2,10 @@
...
@@ -2,6 +2,10 @@
<layout-content
v-loading=
"$store.getters.loadingMap[$store.getters.currentPath]"
>
<layout-content
v-loading=
"$store.getters.loadingMap[$store.getters.currentPath]"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tab-pane
:lazy=
"true"
:label=
"$t('system_parameter_setting.basic_setting')"
name=
"zero"
>
<basic-setting
/>
</el-tab-pane>
<el-tab-pane
:lazy=
"true"
:label=
"$t('system_parameter_setting.mailbox_service_settings')"
name=
"first"
>
<el-tab-pane
:lazy=
"true"
:label=
"$t('system_parameter_setting.mailbox_service_settings')"
name=
"first"
>
<email-setting
/>
<email-setting
/>
</el-tab-pane>
</el-tab-pane>
...
@@ -22,17 +26,17 @@
...
@@ -22,17 +26,17 @@
</layout-content>
</layout-content>
</
template
>
</
template
>
<
script
>
<
script
>
import
BasicSetting
from
'./BasicSetting'
import
EmailSetting
from
'./EmailSetting'
import
EmailSetting
from
'./EmailSetting'
import
LayoutContent
from
'@/components/business/LayoutContent'
import
LayoutContent
from
'@/components/business/LayoutContent'
import
PluginCom
from
'@/views/system/plugin/PluginCom'
import
PluginCom
from
'@/views/system/plugin/PluginCom'
import
{
pluginLoaded
}
from
'@/api/user'
import
{
pluginLoaded
}
from
'@/api/user'
export
default
{
export
default
{
components
:
{
EmailSetting
,
LayoutContent
,
PluginCom
},
components
:
{
BasicSetting
,
EmailSetting
,
LayoutContent
,
PluginCom
},
data
()
{
data
()
{
return
{
return
{
activeName
:
'
first
'
,
activeName
:
'
zero
'
,
isPluginLoaded
:
false
isPluginLoaded
:
false
}
}
},
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论