Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
d8f53be4
Commit
d8f53be4
authored
Apr 20, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat: 系统管理新增解密密匙页面
parent
4008df94
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
0 deletions
+89
-0
authConfigRoute.ts
config/routes/authConfigRoute.ts
+6
-0
index.ts
config/routes/index.ts
+1
-0
index.less
src/pages/systemSetting/key/index.less
+0
-0
index.tsx
src/pages/systemSetting/key/index.tsx
+82
-0
No files found.
config/routes/authConfigRoute.ts
View file @
d8f53be4
...
...
@@ -79,6 +79,12 @@ const AuthConfigRoute: RouterChild = {
},
]
},
/** 密钥管理 */
{
path
:
'/memberCenter/systemSetting/key'
,
name
:
'密钥管理'
,
component
:
'@/pages/systemSetting/key'
,
},
// 收藏管理
{
path
:
'/memberCenter/systemSetting/collection'
,
...
...
config/routes/index.ts
View file @
d8f53be4
...
...
@@ -61,6 +61,7 @@ const memberCenterRoute = {
// // 合同能力
// contracRoute,
//...
// AuthConfigRoute,
...
asyncRoutes
,
{
path
:
'/memberCenter/noAuth'
,
...
...
src/pages/systemSetting/key/index.less
0 → 100644
View file @
d8f53be4
src/pages/systemSetting/key/index.tsx
0 → 100644
View file @
d8f53be4
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Card
,
Row
,
Col
,
Button
,
Typography
}
from
'antd'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
Key
=
()
=>
{
const
[
key
,
setKey
]
=
useState
<
string
>
(
''
);
const
[
fmt
,
setFmt
]
=
useState
<
string
>
(
''
);
const
countTime
=
()
=>
{
//获取当前时间
const
date
=
new
Date
();
const
now
=
date
.
getTime
();
//设置截止时间
const
end
=
Number
(
sessionStorage
.
getItem
(
'time'
));
//时间差
const
leftTime
=
end
-
now
;
//定义变量 d,h,m,s保存倒计时的时间
let
d
,
h
,
m
,
s
;
if
(
leftTime
>=
0
)
{
d
=
Math
.
floor
(
leftTime
/
1000
/
60
/
60
/
24
);
h
=
Math
.
floor
(
leftTime
/
1000
/
60
/
60
%
24
);
m
=
Math
.
floor
(
leftTime
/
1000
/
60
%
60
);
s
=
Math
.
floor
(
leftTime
/
1000
%
60
);
}
//递归每秒调用countTime方法,显示动态时间效果
setFmt
(
`
${
d
}
天
${
h
}
小时
${
m
}
分
${
s
}
秒`
);
setTimeout
(
countTime
,
1000
);
}
const
getSecretKey
=
async
()
=>
{
await
PublicApi
.
getManageSecretKeyGetSecretKey
().
then
((
res
:
any
)
=>
{
if
(
res
.
code
!==
1000
)
{
return
}
const
{
data
}
=
res
;
setKey
(
data
.
secretKey
);
sessionStorage
.
setItem
(
'time'
,
data
.
effectiveTime
)
})
}
useEffect
(()
=>
{
getSecretKey
();
},
[])
useEffect
(()
=>
{
if
(
sessionStorage
.
getItem
(
'time'
))
{
countTime
()
}
},
[
sessionStorage
.
getItem
(
'time'
)])
return
(
<
PageHeaderWrapper
>
<
Card
>
<
Row
>
<
Col
span=
{
24
}
style=
{
{
margin
:
'10px'
}
}
>
<
Typography
.
Text
style=
{
{
display
:
'flex'
,
alignItems
:
'center'
}
}
>
解密密钥:
<
Typography
.
Paragraph
style=
{
{
marginBottom
:
'0'
,
marginLeft
:
'24px'
}
}
strong
copyable=
{
{
icon
:
[<
Button
style=
{
{
marginLeft
:
'24px'
}
}
>
复制密钥
</
Button
>,
<
Button
style=
{
{
marginLeft
:
'24px'
}
}
type=
'primary'
>
复制密钥
</
Button
>]
}
}
>
{
key
}
</
Typography
.
Paragraph
>
</
Typography
.
Text
>
</
Col
>
<
Col
span=
{
24
}
style=
{
{
margin
:
'10px'
}
}
>
<
Typography
.
Text
>
{
`当前解密密钥有效时间:${fmt}`
}
</
Typography
.
Text
>
</
Col
>
<
Col
span=
{
24
}
style=
{
{
margin
:
'10px'
}
}
>
<
Typography
.
Text
>
到期后系统将自动重置解密密钥
</
Typography
.
Text
>
</
Col
>
</
Row
>
</
Card
>
</
PageHeaderWrapper
>
)
}
export
default
Key
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