Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
SHR
/
tFIMS
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 52116f52
authored
Sep 05, 2019
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
db数据加密
1 parent
a07faa38
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
30 additions
and
66 deletions
src/assets/style/fixed/element.scss
src/common/constants.js
src/libs/util.base.data.js
src/libs/util.db.js
src/views/system/login/dialogReg.vue
src/views/system/login/index.js
src/views/system/login/page.vue → src/views/system/login/index.vue
src/views/userManage/role/editDialog.vue
src/views/userManage/user/dialogReg.vue
src/assets/style/fixed/element.scss
View file @
52116f5
...
...
@@ -28,4 +28,9 @@
}
.el-dialog
{
margin-top
:
6vh
!
important
;
&
__footer
{
.el-button
{
width
:
200px
;
}
}
}
\ No newline at end of file
src/common/constants.js
View file @
52116f5
...
...
@@ -2,7 +2,7 @@
* @Author: limin
* @Date: 2019-09-01 19:06:01
* @Last Modified by: limin
* @Last Modified time: 2019-09-05
18:15:54
* @Last Modified time: 2019-09-05
20:06:12
*/
import
{
LOGIN_URL
,
REG_URL
,
Role_LIST_URL
}
from
'@/api/sys.account'
...
...
@@ -42,4 +42,8 @@ export const LogExternals = [
REG_URL
,
// 注册
BaseDataURL
,
//基础数据
Role_LIST_URL
//角色列表
]
\ No newline at end of file
]
/**
* 登录来源
*/
export
const
LOGIN_TYPE
=
1
//1pc,2小程序
\ No newline at end of file
src/libs/util.base.data.js
deleted
100644 → 0
View file @
a07faa3
src/libs/util.db.js
View file @
52116f5
...
...
@@ -3,7 +3,10 @@ import LocalStorage from 'lowdb/adapters/LocalStorage'
import
util
from
'@/libs/util'
import
{
cloneDeep
}
from
'lodash'
const
adapter
=
new
LocalStorage
(
`d2admin-
${
process
.
env
.
VUE_APP_VERSION
}
`
)
const
adapter
=
new
LocalStorage
(
`d2admin-
${
process
.
env
.
VUE_APP_VERSION
}
`
,
{
serialize
:
(
data
)
=>
escape
(
JSON
.
stringify
(
data
)),
deserialize
:
(
data
)
=>
JSON
.
parse
(
unescape
(
data
))
})
const
db
=
low
(
adapter
)
db
...
...
src/views/system/login/dialogReg.vue
View file @
52116f5
...
...
@@ -71,6 +71,7 @@
</el-form>
<div
slot=
"footer"
>
<el-button
@
click=
"submit"
type=
"primary"
class=
"button-submit"
>
提交
</el-button>
<el-button
@
click=
"handleClose"
type=
"plain"
class=
"button-submit"
>
取消
</el-button>
</div>
</el-dialog>
</
template
>
...
...
@@ -237,21 +238,10 @@ $login-dialog-font: 13px;
//
}
}
.el-dialog__footer
{
padding
:
0
0
38px
163px
!important
;
.button-submit
{
width
:
145px
;
height
:
35px
;
border-radius
:
2px
;
letter-spacing
:
2px
;
font-size
:
14px
;
line-height
:
35px
;
padding-top
:
0
;
display
:
flex
;
justify-content
:
center
;
box-sizing
:
border-box
;
span
{
transform
:
translateY
(
-12px
);
}
}
justify-content
:
flex-end
;
//
padding
:
0
0
38px
0
!important
;
}
.sigle-select
{
width
:
100%
;
...
...
src/views/system/login/index.js
deleted
100644 → 0
View file @
a07faa3
import
page
from
'./page'
export
default
page
src/views/system/login/
page
.vue
→
src/views/system/login/
index
.vue
View file @
52116f5
...
...
@@ -36,11 +36,11 @@
<span
class=
"form-sub"
>
让服务更智慧、更直接
</span>
</div>
<div
class=
"input-wrap"
>
<el-form-item
prop=
"
usern
ame"
>
<el-form-item
prop=
"
loginN
ame"
>
<el-input
type=
"text"
v-on:keyup
.
native
.
13=
"submit"
v-model=
"formLogin.
usern
ame"
v-model=
"formLogin.
loginN
ame"
placeholder=
"请输入用户名"
clearable
v-focus
>
...
...
@@ -96,6 +96,7 @@
<
script
>
import
dayjs
from
'dayjs'
import
{
mapActions
,
mapState
}
from
'vuex'
import
{
LOGIN_TYPE
}
from
'@/common/constants'
export
default
{
components
:
{
'DialogReg'
:
()
=>
import
(
'./dialogReg'
),
...
...
@@ -107,13 +108,13 @@ export default {
time
:
dayjs
().
format
(
'HH:mm:ss'
),
// 表单
formLogin
:
{
usern
ame
:
'admin'
,
loginN
ame
:
'admin'
,
password
:
'admin'
,
code
:
'v9am'
loginType
:
LOGIN_TYPE
},
// 表单校验
rules
:
Object
.
freeze
({
usern
ame
:
[
loginN
ame
:
[
{
required
:
true
,
message
:
'请输入用户名'
,
...
...
@@ -144,36 +145,18 @@ export default {
refreshTime
()
{
this
.
time
=
dayjs
().
format
(
'HH:mm:ss'
)
},
/**
* @description 接收选择一个用户快速登录的事件
* @param {Object} user 用户信息
*/
handleUserBtnClick
(
user
)
{
this
.
formLogin
.
username
=
user
.
username
this
.
formLogin
.
password
=
user
.
password
this
.
submit
()
},
/**
* @description 提交表单
*/
// 提交登录信息
submit
()
{
this
.
$refs
.
loginForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
console
.
log
(
this
.
$store
.
state
.
d2admin
.
ua
.
data
);
const
{
browser
,
os
}
=
this
.
$store
.
state
.
d2admin
.
ua
.
data
const
_p
=
{...
this
.
formLogin
,
deviceCode
:
`
${
os
.
name
}${
os
.
version
}
-
${
browser
.
name
}${
browser
.
version
}
`
}
// 登录
// 注意 这里的演示没有传验证码
// 具体需要传递的数据请自行修改代码
this
.
login
({
username
:
this
.
formLogin
.
username
,
password
:
this
.
formLogin
.
password
})
.
then
(()
=>
{
this
.
$store
.
dispatch
(
'd2admin/auth/init'
).
then
(
_
=>
{
// 重定向对象不存在则返回顶层路径
this
.
$router
.
replace
(
this
.
$route
.
query
.
redirect
||
'/'
)
})
})
this
.
login
(
_p
)
.
then
(()
=>
this
.
$store
.
dispatch
(
'd2admin/auth/init'
))
.
then
(
_
=>
this
.
$router
.
replace
(
this
.
$route
.
query
.
redirect
||
'/'
))
}
else
{
// 登录表单校验失败
this
.
$message
.
error
(
'表单校验失败,请检查'
)
...
...
src/views/userManage/role/editDialog.vue
View file @
52116f5
...
...
@@ -117,11 +117,6 @@ export default {
</
script
>
<
style
lang=
"scss"
>
.edit-role-dialog
{
.el-dialog__footer{
.el-button{
width
:
200px
;
}
}
.el-divider--horizontal{
margin
:
30px
0px
20px
;
}
...
...
src/views/userManage/user/dialogReg.vue
View file @
52116f5
...
...
@@ -202,15 +202,3 @@ export default {
}
}
</
script
>
<
style
lang=
"scss"
>
$
login-dialog-lable-width
:
90px
;
$
login-dialog-font
:
13px
;
.reg-dialog-admin
{
.el-dialog__footer
{
text-align
:
right
;
.el-button
{
width
:
200px
;
}
}
}
</
style
>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment