Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
ferry_web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jianan
ferry_web
Commits
09e1815a
Commit
09e1815a
authored
Aug 19, 2020
by
Mr. Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加系统配置。
parent
cb39f04d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
207 additions
and
4 deletions
+207
-4
src/api/system/settings.js
+19
-0
src/views/system/loginlog/index.vue
+4
-4
src/views/system/settings/index.vue
+184
-0
No files found.
src/api/system/settings.js
0 → 100644
View file @
09e1815a
import
request
from
'@/utils/request'
// 设置系统配置信息
export
function
setSettings
(
data
)
{
return
request
({
url
:
'/api/v1/settings'
,
method
:
'post'
,
data
})
}
// 获取系统配置信息
export
function
getSettings
(
params
)
{
return
request
({
url
:
'/api/v1/settings'
,
method
:
'get'
,
params
})
}
src/views/system/loginlog/index.vue
View file @
09e1815a
...
@@ -62,10 +62,10 @@
...
@@ -62,10 +62,10 @@
<el-table
v-loading=
"loading"
border
:data=
"list"
@
selection-change=
"handleSelectionChange"
>
<el-table
v-loading=
"loading"
border
:data=
"list"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"编号"
width=
"
7
0"
align=
"center"
prop=
"infoId"
/>
<el-table-column
label=
"编号"
width=
"
10
0"
align=
"center"
prop=
"infoId"
/>
<el-table-column
label=
"用户名称"
width=
"
85
"
align=
"center"
prop=
"username"
/>
<el-table-column
label=
"用户名称"
width=
"
150
"
align=
"center"
prop=
"username"
/>
<el-table-column
label=
"登录地址"
align=
"center"
prop=
"ipaddr"
width=
"130"
:show-overflow-tooltip=
"true"
/>
<
!--
<
el-table-column
label=
"登录地址"
align=
"center"
prop=
"ipaddr"
width=
"130"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"登录地点"
align=
"center"
prop=
"loginLocation"
/>
<el-table-column
label=
"登录地点"
align=
"center"
prop=
"loginLocation"
/>
-->
<el-table-column
label=
"浏览器"
align=
"center"
prop=
"browser"
/>
<el-table-column
label=
"浏览器"
align=
"center"
prop=
"browser"
/>
<el-table-column
label=
"操作系统"
align=
"center"
prop=
"os"
/>
<el-table-column
label=
"操作系统"
align=
"center"
prop=
"os"
/>
<el-table-column
label=
"操作信息"
width=
"120"
align=
"center"
prop=
"msg"
/>
<el-table-column
label=
"操作信息"
width=
"120"
align=
"center"
prop=
"msg"
/>
...
...
src/views/system/settings/index.vue
0 → 100644
View file @
09e1815a
<
template
>
<div
class=
"app-container"
>
<el-card
class=
"box-card"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
配置信息
</span>
</div>
<div
class=
"text item"
>
<el-form
ref=
"ruleForm"
:model=
"ruleForm"
:rules=
"rules"
label-width=
"100px"
>
<el-form-item
label=
"系统名称:"
prop=
"name"
>
<el-input
v-model=
"ruleForm.name"
/>
</el-form-item>
<el-form-item
label=
"系统Logo:"
prop=
"logo"
>
<el-upload
class=
"avatar-uploader"
:action=
"url"
:data=
"
{type:'1'}"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<img
v-if=
"ruleForm.logo"
:src=
"ruleForm.logo"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
/>
</el-upload>
</el-form-item>
<el-form-item
style=
"margin-bottom: 0"
>
<el-button
type=
"primary"
@
click=
"submitForm('ruleForm', 1)"
>
确定
</el-button>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card
class=
"box-card"
style=
"margin-top: 15px"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
Ldap配置
</span>
</div>
<div
class=
"text item"
>
<el-alert
title=
"Ldap登陆验证通过后,会将用户同步至本地数据库中,请在此配置数据同步的映射关系。单击Ldap字段可编辑,双击可隐藏编辑。"
type=
"info"
style=
"margin-bottom: 10px"
/>
<el-table
:data=
"tableData"
border
style=
"width: 100%"
>
<el-table-column
prop=
"local_field_name"
label=
"字段名称"
width=
"180"
/>
<el-table-column
prop=
"local_field_nick"
label=
"字段昵称"
width=
"180"
/>
<el-table-column
prop=
"ldap_field_name"
label=
"Ldap字段"
>
<template
slot-scope=
"
{row, $index}">
<div
style=
"width: 100%; min-height: 24px;"
@
click=
"
{{
chengenum
(
$index
,
true
)
}}
" @dblclick="
{{
chengenum
(
$index
,
false
)
}}
">
<el-input
v-if=
"editable[$index]"
v-model=
"row.ldap_field_name"
/>
<span
v-else
>
{{
row
.
ldap_field_name
}}
</span>
</div>
</
template
>
</el-table-column>
</el-table>
<div
style=
"margin-top: 20px"
>
<el-button
type=
"primary"
@
click=
"submitForm('ruleForm', 2)"
>
确定
</el-button>
</div>
</div>
</el-card>
</div>
</template>
<
script
>
import
{
setSettings
,
getSettings
}
from
'@/api/system/settings'
export
default
{
components
:
{
},
data
()
{
return
{
url
:
process
.
env
.
VUE_APP_BASE_API
+
'/api/v1/public/uploadFile'
,
editable
:
[],
ruleForm
:
{
name
:
''
,
logo
:
''
},
rules
:
{
name
:
[
{
required
:
true
,
message
:
'请输入系统名称'
,
trigger
:
'blur'
},
{
min
:
3
,
max
:
5
,
message
:
'长度在 3 到 6 个字符'
,
trigger
:
'blur'
}
],
logo
:
[
{
required
:
true
,
message
:
'请设置Logo'
,
trigger
:
'blur'
}
]
},
tableData
:
[]
}
},
mounted
()
{
this
.
getSettingsInfo
()
},
methods
:
{
getSettingsInfo
()
{
getSettings
().
then
(
response
=>
{
for
(
var
v
of
response
.
data
)
{
if
(
v
.
classify
===
1
)
{
this
.
ruleForm
=
v
.
content
}
else
if
(
v
.
classify
===
2
)
{
this
.
tableData
=
v
.
content
}
}
})
},
// 提交配置信息
submitForm
(
formName
,
classify
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
var
jsonValue
=
{
classify
:
classify
}
if
(
classify
===
1
)
{
jsonValue
.
content
=
this
.
ruleForm
}
else
if
(
classify
===
2
)
{
jsonValue
.
content
=
this
.
tableData
}
setSettings
(
jsonValue
).
then
(
response
=>
{
this
.
$message
({
message
:
'设置成功'
,
type
:
'success'
})
})
}
})
},
resetForm
(
formName
)
{
this
.
$refs
[
formName
].
resetFields
()
},
handleAvatarSuccess
(
res
,
file
)
{
this
.
ruleForm
.
logo
=
res
.
data
console
.
log
(
this
.
ruleForm
.
logo
)
},
beforeAvatarUpload
(
file
)
{
const
isLt2M
=
file
.
size
/
1024
/
1024
<
2
if
(
!
isLt2M
)
{
this
.
$message
.
error
(
'上传头像图片大小不能超过 2MB!'
)
}
return
isLt2M
},
chengenum
(
row
,
status
)
{
// 我的方法
this
.
editable
[
row
]
=
status
this
.
$set
(
this
.
editable
,
row
,
status
)
}
}
}
</
script
>
<
style
>
.avatar-uploader
.el-upload
{
border
:
1px
dashed
#d9d9d9
;
border-radius
:
6px
;
cursor
:
pointer
;
position
:
relative
;
overflow
:
hidden
;
}
.avatar-uploader
.el-upload
:hover
{
border-color
:
#409EFF
;
}
.avatar-uploader-icon
{
font-size
:
28px
;
color
:
#8c939d
;
width
:
178px
;
height
:
178px
;
line-height
:
178px
;
text-align
:
center
;
}
.avatar
{
width
:
178px
;
height
:
178px
;
display
:
block
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment