Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-live
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-live
Commits
e8bd5ee0
提交
e8bd5ee0
authored
5月 12, 2021
作者:
pengxiaohui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加白名单,没权限跳转至登录页
上级
fab5ed5c
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
63 行增加
和
10 行删除
+63
-10
DialogDetails.vue
src/components/TableHandles/DialogDetails.vue
+8
-2
routes.js
src/router/routes.js
+3
-3
user.js
src/store/modules/user.js
+26
-1
beforeEnter.js
src/utils/beforeEnter.js
+26
-4
没有找到文件。
src/components/TableHandles/DialogDetails.vue
浏览文件 @
e8bd5ee0
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
<
p
style
=
"line-height:26px;padding:7px 10px 7px 0"
>
{{
details
.
live_config
.
live_summary
}}
<
/p
>
<
p
style
=
"line-height:26px;padding:7px 10px 7px 0"
>
{{
details
.
live_config
.
live_summary
}}
<
/p
>
<
/el-form-item
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"参会成员:"
v
-
if
=
"rowData.status === 2 && operatable"
>
<
el
-
form
-
item
label
=
"参会成员:"
v
-
if
=
"rowData.status === 2 && operatable"
>
<
el
-
button
type
=
"text"
@
click
=
"handleExport"
>
导出
excel
<
/el-button
>
<
el
-
button
type
=
"text"
@
click
=
"handleExport"
:
disabled
=
"exportLoading"
>
导出
excel
<
/el-button><i class="el-icon-loading" v-show="exportLoading"></i
>
<
/el-form-item
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"回放:"
v
-
if
=
"rowData.status === 2 && operatable"
>
<
el
-
form
-
item
label
=
"回放:"
v
-
if
=
"rowData.status === 2 && operatable"
>
<
el
-
button
type
=
"text"
v
-
if
=
"hasRecord"
@
click
=
"handleDownload"
>
下载
<
/el-button
>
<
el
-
button
type
=
"text"
v
-
if
=
"hasRecord"
@
click
=
"handleDownload"
>
下载
<
/el-button
>
...
@@ -43,6 +43,11 @@ export default {
...
@@ -43,6 +43,11 @@ export default {
dialogType
:
{
}
,
dialogType
:
{
}
,
operatable
:
{
}
operatable
:
{
}
}
,
}
,
data
()
{
return
{
exportLoading
:
false
}
}
,
computed
:
{
computed
:
{
hasRecord
()
{
hasRecord
()
{
if
(
this
.
rowData
.
record_file_ids
&&
Array
.
isArray
(
this
.
rowData
.
record_file_ids
)
&&
this
.
rowData
.
record_file_ids
.
length
>
0
)
{
if
(
this
.
rowData
.
record_file_ids
&&
Array
.
isArray
(
this
.
rowData
.
record_file_ids
)
&&
this
.
rowData
.
record_file_ids
.
length
>
0
)
{
...
@@ -72,8 +77,9 @@ export default {
...
@@ -72,8 +77,9 @@ export default {
if
(
row
.
meeting_type
===
1
)
{
if
(
row
.
meeting_type
===
1
)
{
params
.
sub_meeting_id
=
row
.
sub_meeting_id
params
.
sub_meeting_id
=
row
.
sub_meeting_id
}
}
this
.
exportLoading
=
true
exportParticipants
(
params
).
then
((
res
)
=>
{
exportParticipants
(
params
).
then
((
res
)
=>
{
console
.
log
(
res
)
this
.
exportLoading
=
false
if
(
res
&&
res
.
type
===
'text/xlsx'
)
{
if
(
res
&&
res
.
type
===
'text/xlsx'
)
{
const
url
=
URL
.
createObjectURL
(
res
)
const
url
=
URL
.
createObjectURL
(
res
)
this
.
funDownload
(
url
,
`参会人员表_${this.nowFormat
}
.xlsx`
)
this
.
funDownload
(
url
,
`参会人员表_${this.nowFormat
}
.xlsx`
)
...
...
src/router/routes.js
浏览文件 @
e8bd5ee0
...
@@ -26,7 +26,7 @@ export default [
...
@@ -26,7 +26,7 @@ export default [
path
:
''
,
path
:
''
,
component
:
()
=>
import
(
'@/pages/meeting/index.vue'
),
component
:
()
=>
import
(
'@/pages/meeting/index.vue'
),
name
:
'MeetingUpdate'
,
name
:
'MeetingUpdate'
,
meta
:
{
title
:
'
创建
直播'
,
affix
:
true
}
meta
:
{
title
:
'
更新
直播'
,
affix
:
true
}
}
}
]
]
},
},
...
@@ -65,13 +65,13 @@ export default [
...
@@ -65,13 +65,13 @@ export default [
path
:
'role'
,
path
:
'role'
,
name
:
'Role'
,
name
:
'Role'
,
component
:
()
=>
import
(
'@/pages/system/role/index'
),
component
:
()
=>
import
(
'@/pages/system/role/index'
),
meta
:
{
title
:
'角色管理'
,
icon
:
'el-icon-s-check'
}
meta
:
{
title
:
'角色管理'
,
icon
:
'el-icon-s-check'
,
roles
:
[
'administrator'
]
}
},
},
{
{
path
:
'roleToUser'
,
path
:
'roleToUser'
,
name
:
'RoleToUser'
,
name
:
'RoleToUser'
,
component
:
()
=>
import
(
'@/pages/system/role/role-to-user/index'
),
component
:
()
=>
import
(
'@/pages/system/role/role-to-user/index'
),
meta
:
{
title
:
'管理角色用户'
,
icon
:
''
}
meta
:
{
title
:
'管理角色用户'
,
icon
:
''
,
roles
:
[
'administrator'
]
}
},
},
{
{
path
:
'account'
,
path
:
'account'
,
...
...
src/store/modules/user.js
浏览文件 @
e8bd5ee0
...
@@ -5,7 +5,8 @@ const user = {
...
@@ -5,7 +5,8 @@ const user = {
user
:
{},
user
:
{},
roles
:
[],
roles
:
[],
isLogin
:
false
,
isLogin
:
false
,
isSuperAdmin
:
false
isSuperAdmin
:
false
,
hasRoles
:
false
},
},
mutations
:
{
mutations
:
{
...
@@ -20,6 +21,9 @@ const user = {
...
@@ -20,6 +21,9 @@ const user = {
},
},
setSuperAdmin
(
state
,
isSuperAdmin
)
{
setSuperAdmin
(
state
,
isSuperAdmin
)
{
state
.
isSuperAdmin
=
isSuperAdmin
state
.
isSuperAdmin
=
isSuperAdmin
},
setHasRoles
(
state
,
hasRoles
)
{
state
.
hasRoles
=
hasRoles
}
}
},
},
...
@@ -69,6 +73,27 @@ const user = {
...
@@ -69,6 +73,27 @@ const user = {
})
})
commit
(
'setIsLogin'
,
isLogin
)
commit
(
'setIsLogin'
,
isLogin
)
return
isLogin
return
isLogin
},
// 检测登录状态
async
checkRoles
({
commit
})
{
const
hasRoles
=
await
getUserRoles
().
then
(
res
=>
{
const
roles
=
res
.
data
.
roles
let
isSuperAdmin
=
false
if
(
roles
&&
Array
.
isArray
(
roles
))
{
roles
.
forEach
(
it
=>
{
if
(
it
.
name
===
'administrator'
)
isSuperAdmin
=
true
})
commit
(
'setRoles'
,
roles
)
commit
(
'setSuperAdmin'
,
isSuperAdmin
)
return
true
}
return
false
}).
catch
(()
=>
{
commit
(
'setRoles'
,
[])
return
false
})
commit
(
'setHasRoles'
,
hasRoles
)
return
hasRoles
}
}
}
}
}
}
...
...
src/utils/beforeEnter.js
浏览文件 @
e8bd5ee0
import
store
from
'@/store'
import
store
from
'@/store'
/**
* Use meta.role to determine if the current user has permission
* @param roles
* @param routeRoles
*/
function
hasPermission
(
roles
,
routeRoles
)
{
if
(
Array
.
isArray
(
routeRoles
))
{
return
roles
.
some
(
role
=>
routeRoles
.
includes
(
role
))
}
else
{
return
true
}
}
export
default
class
BeforeEnter
{
export
default
class
BeforeEnter
{
constructor
(
opt
)
{
constructor
(
opt
)
{
this
.
opt
=
opt
||
{}
this
.
opt
=
opt
||
{}
}
}
async
update
(
to
,
from
,
next
)
{
async
update
(
to
,
from
,
next
)
{
const
isLogin
=
store
.
state
.
isLogin
||
(
await
store
.
dispatch
(
'checkLogin'
))
const
isLogin
=
store
.
state
.
user
.
isLogin
||
(
await
store
.
dispatch
(
'checkLogin'
))
if
(
to
.
meta
.
requiredLogin
&&
!
isLogin
)
{
const
hasRoles
=
store
.
state
.
user
.
hasRoles
||
(
await
store
.
dispatch
(
'checkRoles'
))
next
(
`/login?redirect_uri=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
)
const
loginUrl
=
`
${
webConf
.
others
.
loginUrl
}
?rd=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
if
(
!
isLogin
||
!
hasRoles
)
{
window
.
location
.
href
=
loginUrl
// next(loginUrl)
return
return
}
else
{
const
roles
=
store
.
state
.
user
.
roles
.
map
(
item
=>
item
.
name
)
if
(
!
hasPermission
(
roles
,
to
.
meta
.
roles
))
{
// next(loginUrl)
window
.
location
.
href
=
loginUrl
return
}
next
()
}
}
store
.
dispatch
(
'setUserRoles'
)
store
.
dispatch
(
'setUserRoles'
)
next
()
next
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论