Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms-admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
cms-admin
Commits
3f8ede6a
提交
3f8ede6a
authored
5月 13, 2021
作者:
pengxiaohui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复权限登录
上级
2be30278
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
102 行增加
和
174 行删除
+102
-174
common.js
src/api/common.js
+0
-113
contentManage.js
src/api/contentManage.js
+7
-0
settings.js
src/api/settings.js
+8
-0
MenuItem.vue
src/components/Layout/Sidebar/MenuItem.vue
+35
-8
index.vue
src/components/Layout/Sidebar/index.vue
+3
-2
header.vue
src/components/Layout/header.vue
+2
-1
index.vue
src/pages/settings/role/index.vue
+10
-1
routes.js
src/router/routes.js
+13
-11
getters.js
src/store/getters.js
+2
-1
user.js
src/store/modules/user.js
+17
-30
axios.js
src/utils/axios.js
+4
-6
beforeEnter.js
src/utils/beforeEnter.js
+1
-1
没有找到文件。
src/api/common.js
deleted
100644 → 0
浏览文件 @
2be30278
import
httpRequest
from
'@/utils/axios'
/**
* 操作日志
*/
export
function
operateLog
(
params
)
{
const
logMsg
=
`操作人:
${
params
.
user
.
nickname
}
,操作:
${
params
.
type
}
`
const
data
=
{
detail
:
logMsg
}
httpRequest
.
post
(
'/api/live/admin/v2/system/log/write'
,
data
).
then
(
res
=>
{
}).
catch
(()
=>
{})
}
/**
* 模糊搜索
*/
export
function
searchUserList
(
params
)
{
return
httpRequest
.
get
(
'/api/live/common/v1/sso-user/search'
,
{
params
})
}
/**
* 创建腾讯用户
*/
export
function
createAccount
(
data
)
{
return
httpRequest
.
post
(
'/api/live/admin/v2/tencent/user'
,
data
)
}
/**
* 获取腾讯用户列表(分页)
*/
export
function
getAccountList
(
params
)
{
return
httpRequest
.
get
(
'/api/live/admin/v2/tencent/users'
,
{
params
})
}
/**
* 获取腾讯用户列表(不分页)
*/
export
function
getAllAccountList
()
{
return
httpRequest
.
get
(
'/api/live/admin/v2/tencent/user/list'
)
}
/**
* 更新腾讯用户
*/
export
function
updateAccount
(
data
)
{
return
httpRequest
.
put
(
`/api/live/admin/v2/tencent/user/
${
data
.
userid
}
/update`
,
data
)
}
/**
* 删除腾讯用户
*/
export
function
deleteAccount
(
params
)
{
return
httpRequest
.
delete
(
`/api/live/admin/v2/tencent/user/
${
params
.
userid
}
/delete`
,
params
)
}
/**
* 创建会议
*/
export
function
createMeeting
(
data
)
{
return
httpRequest
.
post
(
'/api/live/admin/v2/tencent/meeting'
,
data
)
}
/**
* 创建会议
*/
export
function
updateMeeting
(
data
)
{
return
httpRequest
.
put
(
`/api/live/admin/v2/tencent/meeting/
${
data
.
meeting_id
}
/update`
,
data
)
}
/**
* 获取腾讯会议列表
*/
export
function
getMeetingList
(
params
)
{
return
httpRequest
.
get
(
'/api/live/admin/v2/tencent/meetings'
,
{
params
})
}
/**
* 获取腾讯会议列表(不分页)
*/
export
function
getNonpagedMeetingList
(
params
)
{
return
httpRequest
.
get
(
'/api/live/admin/v2/tencent/meeting/list-by-day'
,
{
params
})
}
/**
* 获取腾讯会议详情
*/
export
function
getMeetingDetails
(
params
)
{
return
httpRequest
.
get
(
`/api/live/admin/v2/tencent/meeting/
${
params
.
meeting_id
}
/detail`
,
{
params
})
}
/**
* 通过会议code获取腾讯会议详情
*/
export
function
getMeetingDetailsByCode
(
params
)
{
return
httpRequest
.
get
(
`/api/live/admin/v2/tencent/meeting/
${
params
.
meeting_code
}
/detail-code`
,
{
params
})
}
/**
* 取消(删除)会议
*/
export
function
cancelMeeting
(
params
)
{
return
httpRequest
.
post
(
`/api/live/admin/v2/tencent/meeting/
${
params
.
meeting_id
}
/cancel`
,
params
)
}
/**
* 终止会议
*/
export
function
stopMeeting
(
params
)
{
return
httpRequest
.
post
(
`/api/live/admin/v2/tencent/meeting/
${
params
.
meeting_id
}
/dimiss`
,
params
)
}
/**
* 获取回放地址
*/
export
function
getMeetingRecordAddr
(
params
)
{
return
httpRequest
.
post
(
`/api/live/admin/v2/tencent/meeting/
${
params
.
meeting_id
}
/records/address`
,
params
)
}
/**
* 导出参会人员
*/
export
function
exportParticipants
(
params
)
{
return
httpRequest
({
url
:
`/api/live/admin/v2/tencent/meeting/
${
params
.
meeting_id
}
/participants/export`
,
method
:
'get'
,
params
,
responseType
:
'blob'
})
}
src/api/contentManage.js
0 → 100644
浏览文件 @
3f8ede6a
import
httpRequest
from
'@/utils/axios'
/**
* 获取广告列表
*/
export
function
getAdList
(
params
)
{
return
httpRequest
.
get
(
'/api/cms/api/v1/advertisements'
,
{
params
})
}
src/api/settings.js
0 → 100644
浏览文件 @
3f8ede6a
import
httpRequest
from
'@/utils/axios'
/**
* 获取角色列表
*/
export
function
getRoleList
(
params
)
{
return
httpRequest
.
get
(
'/api/cms/admin/v1/roles'
,
{
params
})
}
\ No newline at end of file
src/components/Layout/Sidebar/MenuItem.vue
浏览文件 @
3f8ede6a
<
template
>
<div>
<el-menu-item
v-if=
"
hasChild(navItem)"
:index=
"navItem.p
ath"
>
<i
:class=
"navItem.icon"
></i>
<span
slot=
"title"
>
{{
navItem
.
title
}}
</span>
<div
v-if=
"!navItem.hidden"
>
<el-menu-item
v-if=
"
!hasChild(navItem)"
:index=
"fullP
ath"
>
<i
:class=
"navItem.
meta.
icon"
></i>
<span
slot=
"title"
>
{{
navItem
.
meta
.
title
}}
</span>
</el-menu-item>
<el-submenu
v-else
ref=
"subMenu"
:index=
"
navItem.p
ath"
>
<el-submenu
v-else
ref=
"subMenu"
:index=
"
fullP
ath"
>
<template
slot=
"title"
>
<i
:class=
"navItem.icon"
></i>
<span>
{{
navItem
.
title
}}
</span>
<i
:class=
"navItem.
meta.
icon"
></i>
<span>
{{
navItem
.
meta
.
title
}}
</span>
</
template
>
<menu-item
v-for=
"child in navItem.children"
:key=
"child.path"
:navItem=
"child"
:parent-path=
"fullPath"
class=
"nest-menu"
/>
</el-submenu>
</div>
</template>
<
script
>
import
path
from
'path'
/**
* @param {string} path
* @returns {Boolean}
*/
export
function
isExternal
(
path
)
{
return
/^
(
https
?
:|mailto:|tel:
)
/
.
test
(
path
)
}
export
default
{
name
:
'MenuItem'
,
props
:
{
navItem
:
{
type
:
Object
,
required
:
true
},
parentPath
:
{
type
:
String
,
default
:
''
}
},
data
()
{
return
{}
},
computed
:
{
routePath
()
{
return
this
.
navItem
.
path
},
fullPath
()
{
if
(
isExternal
(
this
.
routePath
))
{
return
this
.
routePath
}
if
(
isExternal
(
this
.
parentPath
))
{
return
this
.
parentPath
}
return
path
.
resolve
(
this
.
parentPath
,
this
.
routePath
)
}
},
methods
:
{
hasChild
(
item
)
{
return
!
item
.
children
||
(
item
.
children
&&
item
.
children
.
length
===
0
)
return
item
.
children
&&
item
.
children
.
length
>
0
}
}
}
...
...
src/components/Layout/Sidebar/index.vue
浏览文件 @
3f8ede6a
...
...
@@ -18,7 +18,7 @@
:collapse=
"isCollapse"
@
select=
"handlleSelect"
>
<menu-item
v-for=
"item in
menu"
:key=
"item.path"
:navItem=
"item"
/>
<menu-item
v-for=
"item in
permission_routes"
:key=
"item.path"
:navItem=
"item"
:parent-path=
"item.path"
/>
</el-menu>
</el-scrollbar>
</div>
...
...
@@ -84,7 +84,7 @@ export default {
}
},
computed
:
{
...
mapGetters
([
'sidebar'
]),
...
mapGetters
([
'sidebar'
,
'permission_routes'
]),
isCollapse
()
{
return
!
this
.
sidebar
.
opened
}
...
...
@@ -93,6 +93,7 @@ export default {
watch
:
{
$route
:
{
handler
:
function
(
nv
)
{
console
.
log
(
nv
)
if
(
nv
&&
nv
.
path
)
this
.
defaultActive
=
nv
.
path
else
this
.
defaultActive
=
''
},
...
...
src/components/Layout/header.vue
浏览文件 @
3f8ede6a
...
...
@@ -52,7 +52,8 @@ export default {
},
async
logout
()
{
await
this
.
$store
.
dispatch
(
'logout'
)
this
.
$router
.
push
(
`/
${
this
.
$route
.
fullPath
}
`
)
// console.log(this.$route.fullPath)
this
.
$router
.
push
(
this
.
$route
.
fullPath
)
}
}
}
...
...
src/pages/settings/role/index.vue
浏览文件 @
3f8ede6a
...
...
@@ -46,6 +46,7 @@
<
script
>
import
TableList
from
'@/components/TableList'
import
{
permissionList
}
from
'./permission'
import
{
getRoleList
}
from
'@/api/settings.js'
function
recursionData
(
arr
)
{
const
leafArr
=
[]
function
recursion
(
target
)
{
...
...
@@ -235,7 +236,15 @@ export default {
}
})
},
fetchRoleList
()
{},
fetchRoleList
()
{
const
params
=
{
page
:
1
,
limit
:
20
}
getRoleList
(
params
).
then
((
res
)
=>
{
console
.
log
(
res
)
})
},
fetchPermissionList
()
{
const
result
=
permissionList
const
leafNodeList
=
recursionData
(
result
)
...
...
src/router/routes.js
浏览文件 @
3f8ede6a
...
...
@@ -4,32 +4,33 @@ export default [
path
:
'/'
,
name
:
'Layout'
,
component
:
Layout
,
redirect
:
'/content-manage'
redirect
:
'/content-manage'
,
hidden
:
true
},
{
path
:
'/content-manage'
,
component
:
Layout
,
redirect
:
'/content-manage/ads'
,
name
:
'
System
'
,
meta
:
{
title
:
'内容管理'
,
icon
:
'el-icon-
setting
'
},
name
:
'
ContentManage
'
,
meta
:
{
title
:
'内容管理'
,
icon
:
'el-icon-
document
'
},
children
:
[
{
path
:
'ads'
,
name
:
'Ads'
,
component
:
()
=>
import
(
'@/pages/content-manage/ads/index'
),
meta
:
{
title
:
'广告列表'
,
icon
:
''
,
roles
:
[
'content-menu-advert-list'
],
permission
:
'content-menu-advert-list'
}
meta
:
{
title
:
'广告列表'
,
icon
:
''
,
permission
:
'content-menu-advert-list'
}
},
{
path
:
'article'
,
name
:
'Article'
,
component
:
()
=>
import
(
'@/pages/content-manage/article/index'
),
meta
:
{
title
:
'文章列表'
,
icon
:
''
,
roles
:
[
'content-menu-acticle-list'
],
permission
:
'1
'
}
meta
:
{
title
:
'文章列表'
,
icon
:
''
,
permission
:
'content-menu-acticle-list
'
}
},
{
path
:
'image-text'
,
name
:
'ImageText'
,
component
:
()
=>
import
(
'@/pages/content-manage/image-text/index'
),
meta
:
{
title
:
'图文列表'
,
icon
:
''
,
roles
:
[
'content-menu-imgtext-list'
],
permission
:
'2
'
}
meta
:
{
title
:
'图文列表'
,
icon
:
''
,
permission
:
'content-menu-imgtext-list
'
}
}
]
},
...
...
@@ -37,32 +38,32 @@ export default [
path
:
'/settings'
,
component
:
Layout
,
redirect
:
'/settings/staff'
,
name
:
'S
ystem
'
,
name
:
'S
ettings
'
,
meta
:
{
title
:
'设置'
,
icon
:
'el-icon-setting'
},
children
:
[
{
path
:
'staff'
,
name
:
'Staff'
,
component
:
()
=>
import
(
'@/pages/settings/staff/index'
),
meta
:
{
title
:
'员工管理'
,
icon
:
''
,
roles
:
[
'setting-menu-user-manage'
],
permission
:
'
'
}
meta
:
{
title
:
'员工管理'
,
icon
:
''
,
permission
:
'setting-menu-user-manage
'
}
},
{
path
:
'project'
,
name
:
'Project'
,
component
:
()
=>
import
(
'@/pages/settings/project/index'
),
meta
:
{
title
:
'项目管理'
,
icon
:
''
,
roles
:
[
'setting-menu-project-manage'
],
permission
:
'
'
}
meta
:
{
title
:
'项目管理'
,
icon
:
''
,
permission
:
'setting-menu-project-manage
'
}
},
{
path
:
'type'
,
name
:
'Type'
,
component
:
()
=>
import
(
'@/pages/settings/type/index'
),
meta
:
{
title
:
'类型管理'
,
icon
:
''
,
roles
:
[
'setting-menu-type-manage'
],
permission
:
'
'
}
meta
:
{
title
:
'类型管理'
,
icon
:
''
,
permission
:
'setting-menu-type-manage
'
}
},
{
path
:
'role'
,
name
:
'Role'
,
component
:
()
=>
import
(
'@/pages/settings/role/index'
),
meta
:
{
title
:
'高级设置'
,
icon
:
''
,
roles
:
[
'setting-menu-advanced-setting'
],
permission
:
'
'
}
meta
:
{
title
:
'高级设置'
,
icon
:
''
,
permission
:
'setting-menu-advanced-setting
'
}
}
]
},
...
...
@@ -72,6 +73,7 @@ export default [
redirect
:
'/error-page/404'
,
name
:
'ErrorPage'
,
meta
:
{
title
:
'访问出错'
,
icon
:
'el-icon-setting'
},
hidden
:
true
,
children
:
[
{
path
:
'404'
,
...
...
src/store/getters.js
浏览文件 @
3f8ede6a
const
getters
=
{
user
:
state
=>
state
.
user
.
user
,
roles
:
state
=>
state
.
user
.
roles
,
sidebar
:
state
=>
state
.
app
.
sidebar
sidebar
:
state
=>
state
.
app
.
sidebar
,
permission_routes
:
state
=>
state
.
permission
.
routes
}
export
default
getters
src/store/modules/user.js
浏览文件 @
3f8ede6a
import
{
getUser
,
logout
}
from
'@/api/account'
import
{
getUserRolesPermissions
}
from
'@/api/system'
import
router
,
{
resetRouter
}
from
'@/router'
import
{
resetRouter
}
from
'@/router'
const
user
=
{
state
:
{
user
:
{},
isLogin
:
false
,
hasRolesPermissions
:
false
,
roles
:
[]
,
permissions
:
[]
roles
:
null
,
permissions
:
null
},
mutations
:
{
...
...
@@ -58,41 +58,28 @@ const user = {
commit
(
'setIsLogin'
,
isLogin
)
return
isLogin
},
// dynamically modify permissions
async
asyncRouters
({
commit
,
dispatch
},
data
)
{
resetRouter
()
const
roles
=
this
.
roles
console
.
log
(
roles
)
// generate accessible routes map based on roles
const
accessRoutes
=
await
dispatch
(
'permission/routesByPermissions'
,
roles
,
{
root
:
true
})
// dynamically add accessible routes
router
.
addRoutes
(
accessRoutes
)
},
// 检测登录状态
// 检测角色权限
async
checkRolesPermissions
({
commit
})
{
const
hasRolesPermissions
=
await
getUserRolesPermissions
().
then
(
res
=>
{
await
getUserRolesPermissions
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
const
data
=
res
.
data
let
rolePermissionCount
=
0
let
roles
=
[]
let
permissions
=
[]
if
(
data
.
roles
&&
Array
.
isArray
(
data
.
roles
))
{
const
roles
=
data
.
roles
.
forEach
(
it
=>
it
.
name
)
commit
(
'setRoles'
,
roles
)
rolePermissionCount
++
roles
=
data
.
roles
.
forEach
(
it
=>
it
.
name
)
}
commit
(
'setRoles'
,
roles
)
if
(
data
.
permissions
&&
Array
.
isArray
(
data
.
permissions
))
{
rolePermissionCount
++
commit
(
'setPermissions'
,
data
.
permissions
)
permissions
=
data
.
permissions
}
commit
(
'setPermissions'
,
permissions
)
}
else
{
// window.location.href = `${webConf.others.loginUrl}?rd=${encodeURIComponent(window.location.href)}`
}
return
rolePermissionCount
===
2
}).
catch
(()
=>
{
commit
(
'setRoles'
,
[])
commit
(
'setPermissions'
,
[])
return
false
commit
(
'setRoles'
,
null
)
commit
(
'setPermissions'
,
null
)
})
commit
(
'setHasRolesPermissions'
,
hasRolesPermissions
)
// if (hasRolesPermissions) {
// this.asyncRouters()
// }
return
hasRolesPermissions
}
}
}
...
...
src/utils/axios.js
浏览文件 @
3f8ede6a
...
...
@@ -2,7 +2,7 @@ import axios from 'axios'
import
qs
from
'qs'
import
{
Message
}
from
'element-ui'
import
{
getNonce
}
from
'@/utils/utils'
import
router
from
'@/router'
//
import router from '@/router'
const
httpRequest
=
axios
.
create
({
timeout
:
60000
,
withCredentials
:
true
,
...
...
@@ -40,11 +40,10 @@ httpRequest.interceptors.response.use(
const
{
data
}
=
response
if
(
data
.
code
===
1
&&
data
.
msg
===
'请先登录'
)
{
// Message.error(data.msg || data.message)
window
.
location
.
href
=
`
${
webConf
.
others
.
loginUrl
}
?rd=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
//
window.location.href = `${webConf.others.loginUrl}?rd=${encodeURIComponent(window.location.href)}`
return
Promise
.
reject
(
data
)
}
if
(
data
.
code
===
403
)
{
// router.push('/error-page/401')
window
.
location
.
href
=
`
${
webConf
.
others
.
loginUrl
}
?rd=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
}
return
data
...
...
@@ -56,10 +55,9 @@ httpRequest.interceptors.response.use(
if
(
status
===
403
)
{
window
.
location
.
href
=
`
${
webConf
.
others
.
loginUrl
}
?rd=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
}
else
if
(
status
===
400
&&
code
===
401
)
{
router
.
push
(
'/role'
)
//
router.push('/role')
}
else
{
console
.
log
(
message
)
// Message.error(message || error.response.data)
Message
.
error
(
message
||
error
.
response
.
data
)
}
return
Promise
.
reject
(
error
.
response
)
}
else
if
(
typeof
error
===
'string'
)
{
...
...
src/utils/beforeEnter.js
浏览文件 @
3f8ede6a
...
...
@@ -11,7 +11,7 @@ export default class BeforeEnter {
window
.
location
.
href
=
`
${
webConf
.
others
.
loginUrl
}
?rd=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
return
}
else
{
const
hasPermissions
=
store
.
state
.
user
.
permissions
&&
store
.
state
.
user
.
permissions
.
length
>
0
const
hasPermissions
=
store
.
state
.
user
.
permissions
if
(
hasPermissions
)
{
next
()
}
else
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论