Commit 881091ae authored by 杨硕's avatar 杨硕

修改自定义按钮

parent 8055c500
......@@ -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 = []
......
......@@ -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
......
......@@ -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)
......
......@@ -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"-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment