Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
template_vue
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
杨硕
template_vue
Commits
8055c500
Commit
8055c500
authored
Jul 21, 2023
by
杨硕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决tag问题
parent
b6265c9a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
6 deletions
+22
-6
permission.js
src/permission.js
+1
-1
user.js
src/store/modules/user.js
+1
-0
home.vue
src/views/home.vue
+20
-5
No files found.
src/permission.js
View file @
8055c500
...
...
@@ -41,7 +41,7 @@ router.beforeEach((to, from, next) => {
// 根据roles权限生成可访问的路由表
router
.
addRoutes
(
routers
.
accessedRoutes
)
// 动态添加可访问路由表
// TODO: clear this log
console
.
log
(
`routers.accessedRoutes`
,
routers
.
accessedRoutes
)
//
console.log(`routers.accessedRoutes`, routers.accessedRoutes)
// 如果是从中间页面跳转系统首页,默认打开第一个菜单
if
(
to
.
path
===
'/welcome'
)
{
next
({
path
:
routers
.
accessedRoutes
[
0
].
children
[
0
].
path
,
replace
:
true
})
...
...
src/store/modules/user.js
View file @
8055c500
...
...
@@ -87,6 +87,7 @@ const user = {
commit
(
'SET_MENUNAME'
,
menuName
)
// 存入菜单名
const
b
=
menuName
.
join
(
','
)
Cookies
.
set
(
'menuname'
,
b
)
store
.
dispatch
(
'tagsView/delAllViews'
).
then
(
r
=>
{})
resolve
(
menuName
)
})
},
...
...
src/views/home.vue
View file @
8055c500
...
...
@@ -27,7 +27,7 @@
<span
class=
"card-title"
>
生产管理
</span>
</div>
</div>
<div
class=
"home-const"
@
click=
"gotoIndex(equipmentManage)"
>
<div
class=
"home-const
1
"
@
click=
"gotoIndex(equipmentManage)"
>
<div>
<img
src=
"../assets/image/img8@2x.png"
style=
"width: 100%;height: 392px"
>
</div>
...
...
@@ -81,15 +81,13 @@ export default {
})
if
(
index
>
0
)
{
this
.
routerPath
=
routerItem
[
0
].
children
[
0
].
path
// TODO: clear this log
console
.
log
(
`router`
,
this
.
routerPath
)
// this.$message.success('用户有权限')
// 存入点击的菜单名,便于后边路由跳转
this
.
$store
.
dispatch
(
'GetInfoMessage'
,
menuName
).
then
(()
=>
{
// this.$nextTick(() => {
// this.$router.push(this.routerPath)
// }, 5000)
console
.
log
(
'路由跳转'
)
//
console.log('路由跳转')
this
.
$router
.
push
(
'/welcome'
)
})
}
else
{
...
...
@@ -113,7 +111,7 @@ export default {
align-items
:
center
;
justify-content
:
center
;
.home-const
{
width
:
394px
;
width
:
20%
;
height
:
461px
;
margin-right
:
40px
;
background
:
#FFFFFF
;
...
...
@@ -130,6 +128,23 @@ export default {
color
:
#363535
;
}
}
.home-const1
{
width
:
20%
;
height
:
461px
;
background
:
#FFFFFF
;
border-radius
:
8px
8px
8px
8px
;
.card-bottom
{
height
:
70px
;
display
:
flex
;
align-items
:
center
;
}
.card-title
{
font-size
:
18px
;
font-family
:
Microsoft
YaHei-Bold
,
Microsoft
YaHei
;
font-weight
:
bold
;
color
:
#363535
;
}
}
}
</
style
>
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