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
881091ae
Commit
881091ae
authored
Jul 21, 2023
by
杨硕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改自定义按钮
parent
8055c500
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
9 deletions
+19
-9
index.vue
src/components/coolbutton/index.vue
+5
-0
permission.js
src/permission.js
+2
-0
user.js
src/store/modules/user.js
+5
-1
index.vue
src/views/system/role/index.vue
+7
-8
No files found.
src/components/coolbutton/index.vue
View file @
881091ae
...
...
@@ -21,6 +21,7 @@
<
script
>
// import { getInfo } from '@/api/login'
import
store
from
'../../store/index'
import
Cookies
from
'js-cookie'
export
default
{
name
:
'CoolButton'
,
props
:
{
// 调用该组件时需要传递过来的属性
...
...
@@ -69,6 +70,10 @@ export default {
// this.hasper = data
// }
// })
// var p = Cookies.get('permissions')
// const menuList = p.split(',')
// TODO: clear this log
// console.log(`store.getters.permissions`, store.getters.permissions)
if
(
store
.
getters
.
permissions
[
0
]
===
'*:*:*'
)
{
this
.
isShow
=
true
this
.
hasper
=
[]
...
...
src/permission.js
View file @
881091ae
...
...
@@ -38,6 +38,8 @@ router.beforeEach((to, from, next) => {
if
(
routers
.
accessedRoutes
&&
routers
.
accessedRoutes
.
length
>
0
&&
routers
.
getRouters
&&
routers
.
getRouters
.
length
>
0
)
{
// 测试 默认静态页面
// store.dispatch('permission/generateRoutes', { roles }).then(accessRoutes => {
// TODO: clear this log
console
.
log
(
`routers.accessedRoutes`
,
routers
.
accessedRoutes
)
// 根据roles权限生成可访问的路由表
router
.
addRoutes
(
routers
.
accessedRoutes
)
// 动态添加可访问路由表
// TODO: clear this log
...
...
src/store/modules/user.js
View file @
881091ae
...
...
@@ -67,10 +67,14 @@ const user = {
const
avatar
=
user
.
avatar
===
null
?
require
(
'@/assets/image/profile.jpg'
)
:
user
.
avatar
if
(
res
.
data
.
roles
&&
res
.
data
.
roles
.
length
>
0
)
{
// 验证返回的roles是否是一个非空数组
commit
(
'SET_ROLES'
,
res
.
data
.
roles
)
commit
(
'SET_PERMISSIONS'
,
res
.
data
.
permissions
)
// const a = res.data.permissions.join(',')
// // TODO: clear this log
// console.log(`a`, a)
// Cookies.set('permissions', a)
}
else
{
commit
(
'SET_ROLES'
,
[
'ROLE_DEFAULT'
])
}
commit
(
'SET_PERMISSIONS'
,
res
.
data
.
permissions
)
commit
(
'SET_NAME'
,
user
.
username
)
commit
(
'SET_SPECIALTAG'
,
user
.
specialTag
)
commit
(
'SET_AVATAR'
,
avatar
)
...
...
src/views/system/role/index.vue
View file @
881091ae
...
...
@@ -99,14 +99,13 @@
</el-table-column>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"240px"
>
<
template
slot-scope=
"scope"
>
<!--
<el-button-->
<!-- v-hasPermi="['sys:role:update']"-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- style="color: #49cec9"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- >修改
</el-button>
-->
<coolbutton
style=
"color: #49cec9"
:type=
"typeParent"
:name=
"updataName"
:size=
"size"
:haspermi=
"updateHaspermi"
@
btn-click=
"handleUpdate(scope.row)"
/>
<el-button
size=
"mini"
type=
"text"
style=
"color: #49cec9"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
<!--
<coolbutton
style=
"color: #49cec9"
:type=
"typeParent"
:name=
"updataName"
:size=
"size"
:haspermi=
"updateHaspermi"
@
btn-click=
"handleUpdate(scope.row)"
/>
-->
<!--
<el-button-->
<!-- v-hasPermi="['sys:role:update']"-->
<!-- size="mini"-->
...
...
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