Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-fe
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
poc
poc-fe
Commits
51026394
Commit
51026394
authored
Sep 14, 2024
by
nick zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 用户未登录时支持跳转登录页
parent
72d05b9b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
sidebar.vue
src/layout/components/sidebar/sidebar.vue
+18
-1
No files found.
src/layout/components/sidebar/sidebar.vue
View file @
51026394
...
@@ -53,6 +53,13 @@ function handleDropdownSelect(key: string) {
...
@@ -53,6 +53,13 @@ function handleDropdownSelect(key: string) {
router
.
replace
({
name
:
key
})
router
.
replace
({
name
:
key
})
}
}
function
handleToLogin
()
{
router
.
push
({
name
:
'Login'
,
query
:
{
redirect
:
encodeURIComponent
(
router
.
currentRoute
.
value
.
fullPath
)
},
})
}
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -87,7 +94,13 @@ function handleDropdownSelect(key: string) {
...
@@ -87,7 +94,13 @@ function handleDropdownSelect(key: string) {
</div>
</div>
<div
class=
"mb-7"
>
<div
class=
"mb-7"
>
<NDropdown
trigger=
"click"
placement=
"top-start"
:options=
"avatarOptions"
@
select=
"handleDropdownSelect"
>
<NDropdown
v-if=
"userStore.isLogin"
trigger=
"click"
placement=
"top-start"
:options=
"avatarOptions"
@
select=
"handleDropdownSelect"
>
<div
class=
"flex h-full cursor-pointer items-center"
>
<div
class=
"flex h-full cursor-pointer items-center"
>
<NAvatar
round
:size=
"40"
object-fit=
"cover"
:src=
"userStore.userInfo.avatarUrl || defaultAvatar"
/>
<NAvatar
round
:size=
"40"
object-fit=
"cover"
:src=
"userStore.userInfo.avatarUrl || defaultAvatar"
/>
...
@@ -96,6 +109,10 @@ function handleDropdownSelect(key: string) {
...
@@ -96,6 +109,10 @@ function handleDropdownSelect(key: string) {
</div>
</div>
</div>
</div>
</NDropdown>
</NDropdown>
<div
v-else
>
<NButton
type=
"primary"
class=
"w-full! rounded-md!"
@
click=
"handleToLogin"
>
立即登录
</NButton>
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
...
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