Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bigDataSystem
Project
Project
Details
Activity
Releases
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
张伯涛
bigDataSystem
Commits
f72fb7c4
Commit
f72fb7c4
authored
Dec 20, 2024
by
chenjiahao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增:根据用户权限显示不同的可选模块&当登陆后首页才显示个人中心;修复路由问题
parent
3ea08d2c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
32 deletions
+36
-32
UpgradePrompt.vue
src/layouts/default/header/components/UpgradePrompt.vue
+30
-22
index.ts
src/router/routes/index.ts
+0
-8
user.ts
src/store/modules/user.ts
+1
-1
index.vue
src/views/AAAFont/index.vue
+5
-1
No files found.
src/layouts/default/header/components/UpgradePrompt.vue
View file @
f72fb7c4
<
script
setup
lang=
"ts"
>
import
{
h
,
ref
,
onMounted
}
from
'vue'
;
import
{
h
,
ref
,
onMounted
,
computed
}
from
'vue'
;
import
{
Modal
,
Segmented
}
from
'ant-design-vue'
;
import
{
useI18n
}
from
'@/hooks/web/useI18n'
;
import
{
useUserStoreWithOut
}
from
'@/store/modules/user'
;
...
...
@@ -61,16 +61,30 @@
},
]);
const
roleKey
=
ref
(
''
);
onMounted
(()
=>
{
if
(
localStorage
.
getItem
(
'segmentValue'
)
!==
null
)
{
value
.
value
=
localStorage
.
getItem
(
'segmentValue'
);
}
else
{
value
.
value
=
'数据要素'
;
localStorage
.
setItem
(
'type'
,
6
);
switch
(
localStorage
.
getItem
(
'matchedTypes'
)[
0
])
{
case
'1'
:
value
.
value
=
'基础平台'
;
break
;
case
'2'
:
value
.
value
=
'数据治理'
;
break
;
case
'3'
:
value
.
value
=
'数据服务'
;
break
;
case
'4'
:
value
.
value
=
'数仓开发'
;
break
;
case
'6'
:
value
.
value
=
'数据要素'
;
break
;
}
localStorage
.
setItem
(
'segmentValue'
,
value
.
value
);
}
router
.
replace
(
''
+
localStorage
.
getItem
(
'firstChild'
));
router
.
replace
(
localStorage
.
getItem
(
'firstChild'
));
});
// 跳转前台
...
...
@@ -79,6 +93,11 @@
window
.
location
.
reload
();
}
const
filteredData
=
computed
(()
=>
{
const
types
=
localStorage
.
getItem
(
'matchedTypes'
)
||
''
;
return
data
.
value
.
filter
((
item
)
=>
types
.
includes
(
String
(
item
.
payload
.
key
)));
});
async
function
handleSelect
(
type
,
segmentValue
)
{
localStorage
.
setItem
(
'type'
,
type
);
localStorage
.
setItem
(
'segmentValue'
,
segmentValue
);
...
...
@@ -88,23 +107,12 @@
</
script
>
<
template
>
<div>
<!--
<a-button
type=
"primary"
@
click=
"handleSelect(1)"
style=
"margin-right: 10px"
>
{{
-->
<!--
t
(
'layout.header.model1'
)
-->
<!--
}}
</a-button>
-->
<!--
<a-button
type=
"primary"
@
click=
"handleSelect(4)"
style=
"margin-right: 10px"
>
{{
-->
<!--
t
(
'layout.header.model4'
)
-->
<!--
}}
</a-button>
-->
<!--
<a-button
type=
"primary"
@
click=
"handleSelect(2)"
style=
"margin-right: 10px"
>
{{
-->
<!--
t
(
'layout.header.model2'
)
-->
<!--
}}
</a-button>
-->
<!--
<a-button
type=
"primary"
@
click=
"handleSelect(3)"
style=
"margin-right: 10px"
>
{{
-->
<!--
t
(
'layout.header.model3'
)
-->
<!--
}}
</a-button>
-->
<!--
<a-button
type=
"primary"
@
click=
"handleSelect(6)"
style=
"margin-right: 10px"
>
{{
-->
<!--
t
(
'layout.header.model5'
)
-->
<!--
}}
</a-button>
-->
<Segmented
v-show=
"roleKey !== 'test'"
v-model:value=
"value"
:options=
"data"
size=
"large"
>
<Segmented
v-if=
"filteredData.length > 1"
v-model:value=
"value"
:options=
"filteredData"
size=
"large"
>
<template
#
label=
"
{ payload, value: segmentValue }">
<div
@
click=
"handleSelect(payload.key, segmentValue)"
...
...
src/router/routes/index.ts
View file @
f72fb7c4
...
...
@@ -69,14 +69,6 @@ export const PCFontRoute: AppRouteRecordRaw = {
title
:
''
,
},
},
{
path
:
'/aaaFont/individualCenter'
,
name
:
'individualCenter'
,
component
:
()
=>
import
(
'@/views/AAAFont/individualCenter/index.vue'
),
meta
:
{
title
:
''
,
},
},
{
path
:
'/aaaFont/tradingMarket'
,
name
:
'tradingMarket'
,
...
...
src/store/modules/user.ts
View file @
f72fb7c4
...
...
@@ -207,7 +207,6 @@ export const useUserStore = defineStore({
}
else
{
this
.
setRoleList
([
'ROLE_DEFAULT'
]);
}
console
.
log
(
userInfo
.
data
.
menus
);
// 获取动态路由下的第一个菜单路径
const
firstChild
=
await
this
.
getFirstChild
(
userInfo
.
data
.
menus
[
0
]);
console
.
log
(
'firstChild'
,
firstChild
);
...
...
@@ -269,6 +268,7 @@ export const useUserStore = defineStore({
await
this
.
logout
(
true
);
},
});
localStorage
.
clear
();
},
},
});
...
...
src/views/AAAFont/index.vue
View file @
f72fb7c4
...
...
@@ -98,7 +98,7 @@
showPopup
:
false
,
showFixed
:
true
,
timer
:
''
,
isLogin
:
fals
e
,
isLogin
:
tru
e
,
seen
:
true
,
navs
:
[
{
path
:
'/aaaFont/font'
,
text
:
'首页'
},
...
...
@@ -146,6 +146,10 @@
},
},
mounted
()
{
console
.
log
(
getToken
());
if
(
getToken
())
{
this
.
isLogin
=
false
;
}
// window.addEventListener('.el-main', this.handleScroll)
},
methods
:
{
...
...
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