Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
frontend-yd-email
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
Sweet Zhang
frontend-yd-email
Commits
7c84a95f
Commit
7c84a95f
authored
Sep 30, 2025
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决菜单一直存在的问题
parent
266913ac
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletions
+17
-1
src/App.vue
+17
-1
No files found.
src/App.vue
View file @
7c84a95f
<
template
>
<
template
>
<div
id=
"app"
class=
"min-h-screen bg-gray-50 text-gray-800 flex flex-col"
>
<div
id=
"app"
class=
"min-h-screen bg-gray-50 text-gray-800 flex flex-col"
>
<!-- 登录页面 -->
<LoginPage
v-if=
"route.path === '/login'"
@
login=
"handleLogin"
/>
<!-- 主应用布局 -->
<!-- 主应用布局 -->
<div
class=
"flex flex-1 h-screen"
>
<div
v-else
class=
"flex flex-1 h-screen"
>
<!-- 侧边导航 -->
<!-- 侧边导航 -->
<Sidebar
<Sidebar
:current-page=
"currentPage"
:current-page=
"currentPage"
...
@@ -49,6 +52,7 @@
...
@@ -49,6 +52,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
onMounted
,
watch
}
from
'vue'
import
{
ref
,
onMounted
,
watch
}
from
'vue'
import
{
useRoute
,
useRouter
}
from
'vue-router'
import
{
useRoute
,
useRouter
}
from
'vue-router'
import
LoginPage
from
'./views/LoginPage.vue'
import
Sidebar
from
'./views/Sidebar.vue'
import
Sidebar
from
'./views/Sidebar.vue'
import
MobileSidebar
from
'./views/MobileSidebar.vue'
import
MobileSidebar
from
'./views/MobileSidebar.vue'
import
{
pageTitles
}
from
'@/utils/menuConfig'
import
{
pageTitles
}
from
'@/utils/menuConfig'
...
@@ -76,6 +80,18 @@ const toggleSidebar = () => {
...
@@ -76,6 +80,18 @@ const toggleSidebar = () => {
sidebarCollapsed
.
value
=
!
sidebarCollapsed
.
value
sidebarCollapsed
.
value
=
!
sidebarCollapsed
.
value
}
}
// 登录处理
const
handleLogin
=
()
=>
{
// 检查是否有重定向路径
const
redirectPath
=
localStorage
.
getItem
(
'redirectPath'
)
if
(
redirectPath
)
{
router
.
push
(
redirectPath
)
localStorage
.
removeItem
(
'redirectPath'
)
}
else
{
router
.
push
(
'/compose'
)
}
}
// 退出登录处理
// 退出登录处理
const
handleLogout
=
()
=>
{
const
handleLogout
=
()
=>
{
// 清除本地存储的token
// 清除本地存储的token
...
...
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