Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms-admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
cms-admin
Commits
6ea9bc06
提交
6ea9bc06
authored
5月 17, 2021
作者:
pengxiaohui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复bug
上级
3049d783
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
72 行增加
和
42 行删除
+72
-42
index.html
src/index.html
+1
-1
index.vue
src/pages/content-manage/ads/index.vue
+4
-4
index.vue
src/pages/content-manage/article/index.vue
+3
-3
DrawerForm.vue
src/pages/content-manage/components/DrawerForm.vue
+1
-1
index.vue
src/pages/content-manage/image-text/index.vue
+2
-2
index.vue
src/pages/settings/project/index.vue
+4
-4
index.vue
src/pages/settings/staff/index.vue
+2
-2
index.js
src/router/index.js
+5
-0
user.js
src/store/modules/user.js
+16
-7
beforeEnter.js
src/utils/beforeEnter.js
+34
-18
没有找到文件。
src/index.html
浏览文件 @
6ea9bc06
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
id=
"viewport"
id=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no, viewport-fit=cover"
content=
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no, viewport-fit=cover"
/>
/>
<script
src=
"/static/tinymce/tinymce.min.js"
></script>
<script
src=
"
..
/static/tinymce/tinymce.min.js"
></script>
</head>
</head>
<body>
<body>
<div
id=
"app"
></div>
<div
id=
"app"
></div>
...
...
src/pages/content-manage/ads/index.vue
浏览文件 @
6ea9bc06
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
<
template
v-slot:top-status=
"{ row }"
>
<
template
v-slot:top-status=
"{ row }"
>
<div
class=
"table-col-top"
>
<div
class=
"table-col-top"
>
<el-switch
:active-value=
"1"
:inactive-value=
"0"
v-model=
"row.is_top"
@
change=
"handleTop(row)"
:disabled=
"!hasCreate"
></el-switch>
<el-switch
:active-value=
"1"
:inactive-value=
"0"
v-model=
"row.is_top"
@
change=
"handleTop(row)"
:disabled=
"!hasCreate"
></el-switch>
<el-select
v-model=
"row.weight"
placeholder=
"权重"
size=
"mini"
clearable
:disabled=
"!hasCreate"
@
change=
"handleWeight(row)"
>
<el-select
v-model=
"row.weight"
placeholder=
"权重"
size=
"mini"
:disabled=
"!hasCreate"
@
change=
"handleWeight(row)"
>
<el-option
v-for=
"item in 10"
:label=
"item"
:value=
"item"
:key=
"item"
></el-option>
<el-option
v-for=
"item in 10"
:label=
"item"
:value=
"item"
:key=
"item"
></el-option>
</el-select>
</el-select>
</div>
</div>
...
@@ -148,7 +148,7 @@ export default {
...
@@ -148,7 +148,7 @@ export default {
labelKey
:
'name'
,
labelKey
:
'name'
,
valueKey
:
'id'
valueKey
:
'id'
},
},
{
type
:
'input'
,
placeholder
:
'ID'
,
prop
:
'id_title'
},
{
type
:
'input'
,
placeholder
:
'
标题/
ID'
,
prop
:
'id_title'
},
{
{
type
:
'select'
,
type
:
'select'
,
placeholder
:
'类型'
,
placeholder
:
'类型'
,
...
@@ -161,7 +161,7 @@ export default {
...
@@ -161,7 +161,7 @@ export default {
columns
:
[
columns
:
[
{
type
:
'selection'
,
visible
:
this
.
hasDelete
,
fixed
:
'left'
},
{
type
:
'selection'
,
visible
:
this
.
hasDelete
,
fixed
:
'left'
},
{
prop
:
'image_url'
,
label
:
'图片'
,
slots
:
'image'
,
minWidth
:
'80px'
,
fixed
:
'left'
},
{
prop
:
'image_url'
,
label
:
'图片'
,
slots
:
'image'
,
minWidth
:
'80px'
,
fixed
:
'left'
},
{
prop
:
'id'
,
label
:
'广告ID'
,
slots
:
'table-id'
,
minWidth
:
'9
0
px'
,
fixed
:
'left'
},
{
prop
:
'id'
,
label
:
'广告ID'
,
slots
:
'table-id'
,
minWidth
:
'9
5
px'
,
fixed
:
'left'
},
{
prop
:
'title'
,
label
:
'标题'
,
minWidth
:
'100px'
},
{
prop
:
'title'
,
label
:
'标题'
,
minWidth
:
'100px'
},
{
{
prop
:
'start_time'
,
prop
:
'start_time'
,
...
@@ -198,7 +198,7 @@ export default {
...
@@ -198,7 +198,7 @@ export default {
return
dateFormat
(
row
.
created_at
)
||
'-'
return
dateFormat
(
row
.
created_at
)
||
'-'
}
}
},
},
{
prop
:
'audit_status'
,
label
:
'审核状态'
,
slots
:
'review-status'
,
fixed
:
'right'
},
{
prop
:
'audit_status'
,
label
:
'审核状态'
,
slots
:
'review-status'
},
{
prop
:
'is_publish'
,
label
:
'发布状态'
,
slots
:
'publish-status'
,
fixed
:
'right'
},
{
prop
:
'is_publish'
,
label
:
'发布状态'
,
slots
:
'publish-status'
,
fixed
:
'right'
},
{
prop
:
'is_top'
,
label
:
'置顶状态/权重'
,
slots
:
'top-status'
,
minWidth
:
'140px'
,
fixed
:
'right'
}
{
prop
:
'is_top'
,
label
:
'置顶状态/权重'
,
slots
:
'top-status'
,
minWidth
:
'140px'
,
fixed
:
'right'
}
]
]
...
...
src/pages/content-manage/article/index.vue
浏览文件 @
6ea9bc06
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
<
template
v-slot:top-status=
"{ row }"
>
<
template
v-slot:top-status=
"{ row }"
>
<div
class=
"table-col-top"
>
<div
class=
"table-col-top"
>
<el-switch
:active-value=
"1"
:inactive-value=
"0"
v-model=
"row.is_top"
@
change=
"handleTop(row)"
:disabled=
"!hasCreate"
>
>
</el-switch>
<el-switch
:active-value=
"1"
:inactive-value=
"0"
v-model=
"row.is_top"
@
change=
"handleTop(row)"
:disabled=
"!hasCreate"
>
>
</el-switch>
<el-select
v-model=
"row.weight"
placeholder=
"权重"
size=
"mini"
clearable
:disabled=
"!hasCreate"
@
change=
"handleWeight(row)"
>
<el-select
v-model=
"row.weight"
placeholder=
"权重"
size=
"mini"
:disabled=
"!hasCreate"
@
change=
"handleWeight(row)"
>
<el-option
v-for=
"item in 10"
:label=
"item"
:value=
"item"
:key=
"item"
></el-option>
<el-option
v-for=
"item in 10"
:label=
"item"
:value=
"item"
:key=
"item"
></el-option>
</el-select>
</el-select>
</div>
</div>
...
@@ -147,7 +147,7 @@ export default {
...
@@ -147,7 +147,7 @@ export default {
labelKey
:
'name'
,
labelKey
:
'name'
,
valueKey
:
'id'
valueKey
:
'id'
},
},
{
type
:
'input'
,
placeholder
:
'ID'
,
prop
:
'id_title'
},
{
type
:
'input'
,
placeholder
:
'
标题/
ID'
,
prop
:
'id_title'
},
{
{
type
:
'select'
,
type
:
'select'
,
placeholder
:
'类型'
,
placeholder
:
'类型'
,
...
@@ -160,7 +160,7 @@ export default {
...
@@ -160,7 +160,7 @@ export default {
columns
:
[
columns
:
[
{
type
:
'selection'
,
visible
:
this
.
hasDelete
,
fixed
:
'left'
},
{
type
:
'selection'
,
visible
:
this
.
hasDelete
,
fixed
:
'left'
},
{
prop
:
'image_url'
,
label
:
'图片'
,
slots
:
'image'
,
minWidth
:
'80px'
,
fixed
:
'left'
},
{
prop
:
'image_url'
,
label
:
'图片'
,
slots
:
'image'
,
minWidth
:
'80px'
,
fixed
:
'left'
},
{
prop
:
'id'
,
label
:
'文章ID'
,
slots
:
'table-id'
,
minWidth
:
'9
0
px'
,
fixed
:
'left'
},
{
prop
:
'id'
,
label
:
'文章ID'
,
slots
:
'table-id'
,
minWidth
:
'9
5
px'
,
fixed
:
'left'
},
{
prop
:
'title'
,
label
:
'标题'
,
minWidth
:
'100px'
},
{
prop
:
'title'
,
label
:
'标题'
,
minWidth
:
'100px'
},
{
{
prop
:
'start_time'
,
prop
:
'start_time'
,
...
...
src/pages/content-manage/components/DrawerForm.vue
浏览文件 @
6ea9bc06
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
</el-col>
</el-col>
</el-form-item>
</el-form-item>
<el-form-item
label=
"标题:"
prop=
"title"
style=
"margin-right:15px;"
>
<el-form-item
label=
"标题:"
prop=
"title"
style=
"margin-right:15px;"
>
<el-input
v-model=
"form.title"
placeholder=
"请输入
辩
题"
size=
"small"
:disabled=
"isDetails"
/>
<el-input
v-model=
"form.title"
placeholder=
"请输入
标
题"
size=
"small"
:disabled=
"isDetails"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"跳转链接:"
style=
"margin-right:15px;"
>
<el-form-item
label=
"跳转链接:"
style=
"margin-right:15px;"
>
<el-input
v-model=
"form.uri"
placeholder=
"请输入跳转链接"
size=
"small"
:disabled=
"isDetails"
/>
<el-input
v-model=
"form.uri"
placeholder=
"请输入跳转链接"
size=
"small"
:disabled=
"isDetails"
/>
...
...
src/pages/content-manage/image-text/index.vue
浏览文件 @
6ea9bc06
...
@@ -129,7 +129,7 @@ export default {
...
@@ -129,7 +129,7 @@ export default {
labelKey
:
'name'
,
labelKey
:
'name'
,
valueKey
:
'id'
valueKey
:
'id'
},
},
{
type
:
'input'
,
placeholder
:
'ID'
,
prop
:
'id_title'
},
{
type
:
'input'
,
placeholder
:
'
标题/
ID'
,
prop
:
'id_title'
},
{
{
type
:
'select'
,
type
:
'select'
,
placeholder
:
'类型'
,
placeholder
:
'类型'
,
...
@@ -142,7 +142,7 @@ export default {
...
@@ -142,7 +142,7 @@ export default {
columns
:
[
columns
:
[
{
type
:
'selection'
,
visible
:
this
.
hasDelete
,
fixed
:
'left'
},
{
type
:
'selection'
,
visible
:
this
.
hasDelete
,
fixed
:
'left'
},
{
prop
:
'image_url'
,
label
:
'图片'
,
slots
:
'image'
,
minWidth
:
'80px'
,
fixed
:
'left'
},
{
prop
:
'image_url'
,
label
:
'图片'
,
slots
:
'image'
,
minWidth
:
'80px'
,
fixed
:
'left'
},
{
prop
:
'id'
,
label
:
'图文ID'
,
slots
:
'table-id'
,
minWidth
:
'9
0
px'
,
fixed
:
'left'
},
{
prop
:
'id'
,
label
:
'图文ID'
,
slots
:
'table-id'
,
minWidth
:
'9
5
px'
,
fixed
:
'left'
},
{
prop
:
'title'
,
label
:
'标题'
,
minWidth
:
'100px'
},
{
prop
:
'title'
,
label
:
'标题'
,
minWidth
:
'100px'
},
{
{
prop
:
'start_time'
,
prop
:
'start_time'
,
...
...
src/pages/settings/project/index.vue
浏览文件 @
6ea9bc06
...
@@ -199,11 +199,11 @@ export default {
...
@@ -199,11 +199,11 @@ export default {
filters
:
[
filters
:
[
{
{
type
:
'select'
,
type
:
'select'
,
placeholder
:
'项目'
,
placeholder
:
'项目
类型
'
,
prop
:
'type_id'
,
prop
:
'type_id'
,
options
:
this
.
projectList
,
options
:
this
.
project
Type
List
,
labelKey
:
'
project_
name'
,
labelKey
:
'name'
,
valueKey
:
'
project_
id'
valueKey
:
'id'
},
},
{
type
:
'input'
,
placeholder
:
'项目ID/项目名称'
,
prop
:
'name'
},
{
type
:
'input'
,
placeholder
:
'项目ID/项目名称'
,
prop
:
'name'
},
{
{
...
...
src/pages/settings/staff/index.vue
浏览文件 @
6ea9bc06
...
@@ -218,8 +218,8 @@ export default {
...
@@ -218,8 +218,8 @@ export default {
placeholder
:
'项目'
,
placeholder
:
'项目'
,
prop
:
'project_id'
,
prop
:
'project_id'
,
options
:
this
.
projectList
,
options
:
this
.
projectList
,
labelKey
:
'
project_
name'
,
labelKey
:
'name'
,
valueKey
:
'
project_
id'
valueKey
:
'id'
},
},
{
type
:
'input'
,
placeholder
:
'手机号/邮箱'
,
prop
:
'id'
},
{
type
:
'input'
,
placeholder
:
'手机号/邮箱'
,
prop
:
'id'
},
{
{
...
...
src/router/index.js
浏览文件 @
6ea9bc06
...
@@ -3,6 +3,11 @@ import Router from 'vue-router'
...
@@ -3,6 +3,11 @@ import Router from 'vue-router'
import
routes
from
'./routes'
import
routes
from
'./routes'
Vue
.
use
(
Router
)
Vue
.
use
(
Router
)
const
originalPush
=
Router
.
prototype
.
push
Router
.
prototype
.
push
=
function
push
(
location
)
{
return
originalPush
.
call
(
this
,
location
).
catch
(
err
=>
err
)
}
export
const
asyncRoutes
=
[...
routes
]
export
const
asyncRoutes
=
[...
routes
]
const
createRouter
=
()
=>
new
Router
({
const
createRouter
=
()
=>
new
Router
({
mode
:
'history'
,
// require service support
mode
:
'history'
,
// require service support
...
...
src/store/modules/user.js
浏览文件 @
6ea9bc06
...
@@ -23,9 +23,6 @@ const user = {
...
@@ -23,9 +23,6 @@ const user = {
setPermissions
(
state
,
permissions
)
{
setPermissions
(
state
,
permissions
)
{
state
.
permissions
=
permissions
state
.
permissions
=
permissions
},
},
setHasRolesPermissions
(
state
,
hasRolesPermissions
)
{
state
.
hasRolesPermissions
=
hasRolesPermissions
},
setProjects
(
state
,
projects
)
{
setProjects
(
state
,
projects
)
{
state
.
projects
=
projects
state
.
projects
=
projects
}
}
...
@@ -37,6 +34,9 @@ const user = {
...
@@ -37,6 +34,9 @@ const user = {
return
logout
().
then
(
response
=>
{
return
logout
().
then
(
response
=>
{
commit
(
'setUser'
,
{})
commit
(
'setUser'
,
{})
commit
(
'setIsLogin'
,
false
)
commit
(
'setIsLogin'
,
false
)
commit
(
'setRoles'
,
null
)
commit
(
'setPermissions'
,
null
)
commit
(
'projects'
,
[])
resetRouter
()
resetRouter
()
return
response
return
response
})
})
...
@@ -63,13 +63,14 @@ const user = {
...
@@ -63,13 +63,14 @@ const user = {
},
},
// 检测角色权限
// 检测角色权限
async
checkRolesPermissions
({
commit
})
{
async
checkRolesPermissions
({
commit
})
{
await
getUserRolesPermissions
().
then
(
res
=>
{
const
obj
=
await
getUserRolesPermissions
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
const
data
=
res
.
data
const
data
=
res
.
data
let
roles
=
[]
let
roles
=
[]
let
permissions
=
[]
let
permissions
=
[]
let
projects
=
[]
if
(
data
.
roles
&&
Array
.
isArray
(
data
.
roles
))
{
if
(
data
.
roles
&&
Array
.
isArray
(
data
.
roles
))
{
roles
=
data
.
roles
.
forEach
(
it
=>
it
.
name
)
roles
=
data
.
roles
.
map
(
it
=>
it
.
name
)
}
}
commit
(
'setRoles'
,
roles
)
commit
(
'setRoles'
,
roles
)
if
(
data
.
permissions
&&
Array
.
isArray
(
data
.
permissions
))
{
if
(
data
.
permissions
&&
Array
.
isArray
(
data
.
permissions
))
{
...
@@ -77,18 +78,26 @@ const user = {
...
@@ -77,18 +78,26 @@ const user = {
}
}
commit
(
'setPermissions'
,
permissions
)
commit
(
'setPermissions'
,
permissions
)
if
(
data
.
projects
&&
Array
.
isArray
(
data
.
projects
))
{
if
(
data
.
projects
&&
Array
.
isArray
(
data
.
projects
))
{
commit
(
'setProjects'
,
data
.
projects
)
projects
=
data
.
projects
commit
(
'setProjects'
,
projects
)
}
else
{
}
else
{
commit
(
'setProjects'
,
[])
commit
(
'setProjects'
,
[])
}
}
return
{
roles
,
permissions
,
projects
}
}
else
{
}
else
{
// window.location.href = `${webConf.others.loginUrl}?rd=${encodeURIComponent(window.location.href)}`
return
{}
}
}
}).
catch
(()
=>
{
}).
catch
(()
=>
{
commit
(
'setRoles'
,
null
)
commit
(
'setRoles'
,
null
)
commit
(
'setPermissions'
,
null
)
commit
(
'setPermissions'
,
null
)
commit
(
'setProjects'
,
[])
commit
(
'setProjects'
,
[])
return
{}
})
})
return
obj
}
}
}
}
}
}
...
...
src/utils/beforeEnter.js
浏览文件 @
6ea9bc06
...
@@ -9,30 +9,46 @@ export default class BeforeEnter {
...
@@ -9,30 +9,46 @@ export default class BeforeEnter {
const
isLogin
=
store
.
state
.
user
.
isLogin
||
(
await
store
.
dispatch
(
'checkLogin'
))
const
isLogin
=
store
.
state
.
user
.
isLogin
||
(
await
store
.
dispatch
(
'checkLogin'
))
if
(
!
isLogin
)
{
if
(
!
isLogin
)
{
window
.
location
.
href
=
`
${
webConf
.
others
.
loginUrl
}
?rd=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
window
.
location
.
href
=
`
${
webConf
.
others
.
loginUrl
}
?rd=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
return
next
()
}
else
{
}
else
{
const
hasPermissions
=
store
.
state
.
user
.
permissions
const
hasPermissions
=
store
.
state
.
user
.
permissions
&&
store
.
state
.
user
.
permissions
.
length
>
0
if
(
hasPermissions
)
{
if
(
hasPermissions
)
{
next
()
const
permissions
=
store
.
state
.
user
.
permissions
if
(
to
.
path
.
includes
(
'error-page'
))
{
next
()
}
else
{
if
(
!
permissions
.
includes
(
to
.
meta
.
permission
))
{
router
.
push
(
'/error-page/401'
)
}
next
()
}
}
else
{
}
else
{
try
{
const
{
permissions
}
=
await
store
.
dispatch
(
'checkRolesPermissions'
)
await
store
.
dispatch
(
'checkRolesPermissions'
)
if
(
!
permissions
.
length
)
{
const
permissions
=
store
.
state
.
user
.
permissions
window
.
location
.
href
=
`
${
webConf
.
others
.
loginUrl
}
?rd=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
// 基于权限获取可接入的路由
const
accessRoutes
=
await
store
.
dispatch
(
'permission/routesByPermissions'
,
permissions
)
// 重新设置路由
resetRouter
()
// dynamically add accessible routes
router
.
addRoutes
(
accessRoutes
)
// hack method to ensure that addRoutes is complete
// set the replace: true, so the navigation will not leave a history record
next
({
...
to
,
replace
:
true
})
}
catch
(
error
)
{
next
()
next
()
}
else
{
try
{
// 基于权限获取可接入的路由
const
accessRoutes
=
await
store
.
dispatch
(
'permission/routesByPermissions'
,
permissions
)
// 重新设置路由
resetRouter
()
// 动态添加路由
router
.
addRoutes
(
accessRoutes
)
next
({
...
to
,
replace
:
true
})
}
catch
(
error
)
{
next
()
}
if
(
to
.
path
.
includes
(
'error-page'
))
{
next
()
}
else
{
if
(
!
permissions
.
includes
(
to
.
meta
.
permission
))
{
router
.
replace
(
'/error-page/401'
)
}
next
()
}
}
}
}
}
}
}
// store.dispatch('setUserRoles')
next
()
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论