Commit 7aeff8fd by Lyan

bug修改

parent 9daec549
...@@ -5,7 +5,7 @@ import store from '@/store' ...@@ -5,7 +5,7 @@ import store from '@/store'
/** /**
* 获取uuid * 获取uuid
*/ */
export function getUUID() { export function getUUID () {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
return (c === 'x' ? (Math.random() * 16 | 0) : ('r&0x3' | '0x8')).toString(16) return (c === 'x' ? (Math.random() * 16 | 0) : ('r&0x3' | '0x8')).toString(16)
}) })
...@@ -15,7 +15,7 @@ export function getUUID() { ...@@ -15,7 +15,7 @@ export function getUUID() {
* 是否有权限 * 是否有权限
* @param {*} key * @param {*} key
*/ */
export function isAuth(key) { export function isAuth (key) {
return JSON.parse(localStorage.getItem('permissions') || '[]').indexOf(key) !== -1 || false return JSON.parse(localStorage.getItem('permissions') || '[]').indexOf(key) !== -1 || false
} }
...@@ -25,7 +25,7 @@ export function isAuth(key) { ...@@ -25,7 +25,7 @@ export function isAuth(key) {
* @param {*} id * @param {*} id
* @param {*} pid * @param {*} pid
*/ */
export function treeDataTranslate(data, id = 'id', pid = 'parentId') { export function treeDataTranslate (data, id = 'id', pid = 'parentId') {
var res = [] var res = []
var temp = {} var temp = {}
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
...@@ -51,7 +51,7 @@ export function treeDataTranslate(data, id = 'id', pid = 'parentId') { ...@@ -51,7 +51,7 @@ export function treeDataTranslate(data, id = 'id', pid = 'parentId') {
/** /**
* 清除登录信息 * 清除登录信息
*/ */
export function clearLoginInfo() { export function clearLoginInfo () {
localStorage.removeItem('token') localStorage.removeItem('token')
store.commit('resetStore') store.commit('resetStore')
router.options.isAddDynamicMenuRoutes = false router.options.isAddDynamicMenuRoutes = false
...@@ -79,7 +79,7 @@ export const piclevelList = [ ...@@ -79,7 +79,7 @@ export const piclevelList = [
}, },
{ {
name: '4', name: '4',
value: 4, value: 4
}, },
{ {
name: '5', name: '5',
......
...@@ -148,9 +148,9 @@ ...@@ -148,9 +148,9 @@
<el-button v-if="isAuth('manage:center:check')" type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button> <el-button v-if="isAuth('manage:center:check')" type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button v-if="isAuth('manage:center:check')" type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button> <el-button v-if="isAuth('manage:center:check')" type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br v-if="isAuth('manage:center:check')" /> <br v-if="isAuth('manage:center:check')" />
<el-button v-if="isAuth('manage:center:check')" type="text" size="small" @click="showMsg(scope.row)">预览</el-button> <el-button v-if="isAuth('manage:center:info')" type="text" size="small" @click="showMsg(scope.row)">预览</el-button>
<el-button v-if="isAuth('manage:center:check')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button> <el-button v-if="isAuth('manage:center:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button v-if="isAuth('manage:center:check')" type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button v-if="isAuth('manage:center:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
...@@ -143,12 +143,12 @@ ...@@ -143,12 +143,12 @@
width="150" width="150"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button> <el-button v-if="isAuth('manage:topicnews:check')" type="text" size="small" @click="checkHandle(scope.row.id,1)">[成功]</el-button>
<el-button type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button> <el-button v-if="isAuth('manage:topicnews:check')" type="text" size="small" @click="checkHandle(scope.row.id,-1)">[失败]</el-button>
<br /> <br v-if="isAuth('manage:topicnews:check')" />
<el-button type="text" size="small" @click="showMsg(scope.row)">预览</el-button> <el-button v-if="isAuth('manage:topicnews:info')" type="text" size="small" @click="showMsg(scope.row)">预览</el-button>
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button> <el-button v-if="isAuth('manage:topicnews:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button> <el-button v-if="isAuth('manage:topicnews:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
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