Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
fe-data-trusted-space
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
a6fe3478
authored
2025-02-24 17:25:33 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
登录页面改成主页
1 parent
6aabcc7e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
20 deletions
src/router/index.ts
src/router/routes.ts
src/store/modules/user.ts
src/router/index.ts
View file @
a6fe347
...
...
@@ -38,10 +38,11 @@ router.beforeEach(async (to, from, next) => {
settingsStore
.
settings
.
menu
.
menuMode
!==
'single'
&&
menuStore
.
setActived
(
to
.
path
)
// 如果已登录状态下,进入登录页会强制跳转到主页
if
(
to
.
name
===
'login'
)
{
next
({
name
:
'login'
,
replace
:
true
,
})
// next({
// name: 'login',
// replace: true,
// })
window
.
location
.
href
=
userStore
.
idassLoginUrl
;
}
else
if
(
to
.
name
==
'scenes'
)
{
next
({
...
...
@@ -130,12 +131,13 @@ router.beforeEach(async (to, from, next) => {
next
()
}
else
if
(
!
to
.
query
.
code
&&
to
.
name
!==
'login'
)
{
next
({
name
:
'login'
,
query
:
{
redirect
:
to
.
fullPath
!==
'/'
?
to
.
fullPath
:
undefined
,
},
})
window
.
location
.
href
=
userStore
.
idassLoginUrl
;
// next({
// name: 'login',
// query: {
// redirect: to.fullPath !== '/' ? to.fullPath : undefined,
// },
// })
}
else
{
next
()
...
...
src/router/routes.ts
View file @
a6fe347
...
...
@@ -27,14 +27,14 @@ interface metaInfoRaw {
// 固定路由(默认路由)
const
constantRoutes
:
RouteRecordRaw
[]
=
[
{
path
:
'/login'
,
name
:
'login'
,
component
:
()
=>
import
(
'@/views/login.vue'
),
meta
:
{
title
:
'登录'
,
},
},
//
{
//
path: '/login',
//
name: 'login',
//
component: () => import('@/views/login.vue'),
//
meta: {
//
title: '登录',
//
},
//
},
{
path
:
'/register'
,
name
:
'register'
,
...
...
src/store/modules/user.ts
View file @
a6fe347
...
...
@@ -176,7 +176,7 @@ const useUserStore = defineStore(
menuStore
.
setActived
(
0
)
tabbar
.
value
=
[]
tabbarMap
.
value
=
{}
window
.
location
.
href
=
idassLoginUrl
+
'?logout=1'
;
window
.
location
.
href
=
idassLoginUrl
.
value
+
'?logout=1'
;
});
}
else
{
let
hasCode
=
localStorage
.
getItem
(
'code'
);
...
...
@@ -195,7 +195,7 @@ const useUserStore = defineStore(
tabbar
.
value
=
[]
tabbarMap
.
value
=
{}
if
(
hasCode
)
{
window
.
location
.
href
=
idassLoginUrl
+
'?logout=1'
;
window
.
location
.
href
=
idassLoginUrl
.
value
+
'?logout=1'
;
}
else
{
router
.
push
({
name
:
'login'
,
...
...
@@ -313,6 +313,7 @@ const useUserStore = defineStore(
permissions
,
isLogin
,
isLoginOut
,
idassLoginUrl
,
getTokenPromise
,
getToken
,
login
,
...
...
Write
Preview
Styling with
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