Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
c2260dbc
Commit
c2260dbc
authored
Jul 15, 2024
by
“yiyousong”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 优化证书弹窗逻辑
parent
382c6667
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
30 deletions
+38
-30
portal-manager-ui/admin/src/components/licenseHint/LicenseHint.vue
...nager-ui/admin/src/components/licenseHint/LicenseHint.vue
+3
-0
portal-manager-ui/admin/src/router/index.js
portal-manager-ui/admin/src/router/index.js
+11
-5
portal-manager-ui/admin/src/store/modules/user.js
portal-manager-ui/admin/src/store/modules/user.js
+23
-1
portal-manager-ui/admin/src/views/signIn/signIn.vue
portal-manager-ui/admin/src/views/signIn/signIn.vue
+1
-24
No files found.
portal-manager-ui/admin/src/components/licenseHint/LicenseHint.vue
View file @
c2260dbc
...
@@ -92,12 +92,14 @@ export default {
...
@@ -92,12 +92,14 @@ export default {
},
},
// 检测系统证书
// 检测系统证书
async
checkCipher
()
{
async
checkCipher
()
{
let
date
=
this
.
$moment
().
format
(
"
YYYY-MM-DD
"
);
let
res
=
await
checkCipher
();
let
res
=
await
checkCipher
();
if
(
res
.
code
==
1
)
{
if
(
res
.
code
==
1
)
{
let
{
startTime
,
endTime
}
=
res
.
data
;
let
{
startTime
,
endTime
}
=
res
.
data
;
let
msg
=
`证书上传成功,证书有效期:
${
startTime
}
至
${
endTime
}
`
;
let
msg
=
`证书上传成功,证书有效期:
${
startTime
}
至
${
endTime
}
`
;
this
.
set_licenseInfo
({
this
.
set_licenseInfo
({
isExpire
:
false
,
isExpire
:
false
,
date
,
msg
:
""
,
msg
:
""
,
});
});
this
.
$message
.
success
(
msg
);
this
.
$message
.
success
(
msg
);
...
@@ -105,6 +107,7 @@ export default {
...
@@ -105,6 +107,7 @@ export default {
}
else
{
}
else
{
this
.
set_licenseInfo
({
this
.
set_licenseInfo
({
isExpire
:
true
,
isExpire
:
true
,
date
,
msg
:
res
.
msg
,
msg
:
res
.
msg
,
});
});
}
}
...
...
portal-manager-ui/admin/src/router/index.js
View file @
c2260dbc
...
@@ -2,6 +2,7 @@ import Vue from "vue";
...
@@ -2,6 +2,7 @@ import Vue from "vue";
import
VueRouter
from
"
vue-router
"
;
import
VueRouter
from
"
vue-router
"
;
import
routeConfig
from
"
./routes
"
;
import
routeConfig
from
"
./routes
"
;
import
store
from
"
@/store/index
"
;
import
store
from
"
@/store/index
"
;
import
moment
from
"
moment
"
;
Vue
.
use
(
VueRouter
);
Vue
.
use
(
VueRouter
);
Vue
.
use
(
store
);
Vue
.
use
(
store
);
...
@@ -20,17 +21,22 @@ const router = new VueRouter({
...
@@ -20,17 +21,22 @@ const router = new VueRouter({
base
:
process
.
env
.
BASE_URL
,
base
:
process
.
env
.
BASE_URL
,
routes
:
routeConfig
,
routes
:
routeConfig
,
});
});
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
let
islogin
=
store
.
getters
[
"
user/token
"
];
let
islogin
=
store
.
getters
[
"
user/token
"
];
let
date
=
moment
().
format
(
"
YYYY-MM-DD
"
);
if
(
date
!=
store
.
getters
[
"
user/licenseInfo
"
].
date
)
{
await
store
.
dispatch
(
"
user/checkCipher
"
);
}
// let routerPath = store.getters["user/routerList"];
// let routerPath = store.getters["user/routerList"];
// let toRootPathArr = to.matched.map((v) => v.path);
// let toRootPathArr = to.matched.map((v) => v.path);
// let bol = hasIntersection(toRootPathArr, routerPath);
// let bol = hasIntersection(toRootPathArr, routerPath);
let
licenseInfo
=
store
.
getters
[
"
user/licenseInfo
"
];
if
(
licenseInfo
.
isExpire
)
{
Vue
.
prototype
.
$licenseHintModal
();
}
if
(
islogin
)
{
if
(
islogin
)
{
next
();
next
();
let
licenseInfo
=
store
.
getters
[
"
user/licenseInfo
"
];
if
(
licenseInfo
.
isExpire
)
{
Vue
.
prototype
.
$licenseHintModal
();
}
// if (routerPath.includes(to.path) || bol) {
// if (routerPath.includes(to.path) || bol) {
// next();
// next();
// }
// }
...
...
portal-manager-ui/admin/src/store/modules/user.js
View file @
c2260dbc
import
{
censusListInterface
}
from
"
@/api/dataAdmin.js
"
;
import
{
censusListInterface
}
from
"
@/api/dataAdmin.js
"
;
import
{
appsListInterface
}
from
"
@/api/siteArrange.js
"
;
import
{
appsListInterface
}
from
"
@/api/siteArrange.js
"
;
import
{
checkCipher
}
from
"
@/api/user.js
"
;
import
moment
from
"
moment
"
;
export
default
{
export
default
{
namespaced
:
true
,
namespaced
:
true
,
state
:
{
state
:
{
...
@@ -14,6 +16,7 @@ export default {
...
@@ -14,6 +16,7 @@ export default {
routerList
:
[],
// 用户权限路由
routerList
:
[],
// 用户权限路由
licenseInfo
:
{
licenseInfo
:
{
// 系统证书信息
// 系统证书信息
date
:
""
,
// 今日日期
isExpire
:
false
,
// 是否过期,
isExpire
:
false
,
// 是否过期,
msg
:
""
,
// 过期提示信息
msg
:
""
,
// 过期提示信息
},
},
...
@@ -66,8 +69,9 @@ export default {
...
@@ -66,8 +69,9 @@ export default {
set_siteId
(
state
,
siteId
)
{
set_siteId
(
state
,
siteId
)
{
state
.
siteId
=
siteId
;
state
.
siteId
=
siteId
;
},
},
set_licenseInfo
(
state
,
{
isExpire
,
msg
})
{
set_licenseInfo
(
state
,
{
isExpire
,
date
,
msg
})
{
state
.
licenseInfo
.
isExpire
=
isExpire
;
state
.
licenseInfo
.
isExpire
=
isExpire
;
state
.
licenseInfo
.
date
=
date
;
state
.
licenseInfo
.
msg
=
msg
;
state
.
licenseInfo
.
msg
=
msg
;
},
},
// 重置所有仓库状态
// 重置所有仓库状态
...
@@ -90,5 +94,23 @@ export default {
...
@@ -90,5 +94,23 @@ export default {
}
}
});
});
},
},
async
checkCipher
(
context
)
{
let
date
=
moment
().
format
(
"
YYYY-MM-DD
"
);
let
res
=
await
checkCipher
();
let
{
code
}
=
res
;
if
(
code
==
1
)
{
context
.
commit
(
"
set_licenseInfo
"
,
{
isExpire
:
false
,
date
,
msg
:
""
,
});
}
else
{
context
.
commit
(
"
set_licenseInfo
"
,
{
isExpire
:
true
,
date
,
msg
:
res
.
msg
,
});
}
},
},
},
};
};
portal-manager-ui/admin/src/views/signIn/signIn.vue
View file @
c2260dbc
...
@@ -248,12 +248,7 @@
...
@@ -248,12 +248,7 @@
<
script
>
<
script
>
import
Swiper
from
"
swiper
"
;
import
Swiper
from
"
swiper
"
;
import
{
import
{
LoginInterface
,
changeForgotPassword
,
getSlogan
}
from
"
@/api/user.js
"
;
LoginInterface
,
changeForgotPassword
,
getSlogan
,
checkCipher
,
}
from
"
@/api/user.js
"
;
import
{
mapMutations
,
mapState
}
from
"
vuex
"
;
import
{
mapMutations
,
mapState
}
from
"
vuex
"
;
import
{
changeAccount
,
changePassWord
}
from
"
@/utils/js/validate
"
;
import
{
changeAccount
,
changePassWord
}
from
"
@/utils/js/validate
"
;
import
{
encrypt
,
findSitesById
}
from
"
@/utils
"
;
import
{
encrypt
,
findSitesById
}
from
"
@/utils
"
;
...
@@ -334,7 +329,6 @@ export default {
...
@@ -334,7 +329,6 @@ export default {
this
.
createCode
();
this
.
createCode
();
},
},
mounted
()
{
mounted
()
{
this
.
checkCipher
();
this
.
initSwiper
();
this
.
initSwiper
();
},
},
methods
:
{
methods
:
{
...
@@ -343,24 +337,7 @@ export default {
...
@@ -343,24 +337,7 @@ export default {
"
SET_USERDATA
"
,
"
SET_USERDATA
"
,
"
set_siteList
"
,
"
set_siteList
"
,
"
SET_routerList
"
,
"
SET_routerList
"
,
"
set_licenseInfo
"
,
]),
]),
// 检测系统证书是否过期
async
checkCipher
()
{
let
res
=
await
checkCipher
();
if
(
res
.
code
==
1
)
{
this
.
set_licenseInfo
({
isExpire
:
false
,
msg
:
""
,
});
}
else
{
this
.
set_licenseInfo
({
isExpire
:
true
,
msg
:
res
.
msg
,
});
this
.
$licenseHintModal
();
}
},
getTitle
()
{
getTitle
()
{
getSlogan
(
"
signImg
"
).
then
((
res
)
=>
{
getSlogan
(
"
signImg
"
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
if
(
res
.
code
==
1
)
{
...
...
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