Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
绝世唐门三哥
Vue Manage System
提交
78803890
Vue Manage System
项目概览
绝世唐门三哥
/
Vue Manage System
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Vue Manage System
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
78803890
编写于
4月 19, 2018
作者:
L
lin-xin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
'新增403页面'
上级
6e54b705
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
72 addition
and
3 deletion
+72
-3
src/components/common/Sidebar.vue
src/components/common/Sidebar.vue
+5
-0
src/components/page/403.vue
src/components/page/403.vue
+56
-0
src/components/page/404.vue
src/components/page/404.vue
+1
-1
src/components/page/Permission.vue
src/components/page/Permission.vue
+1
-1
src/main.js
src/main.js
+1
-1
src/router/index.js
src/router/index.js
+8
-0
未找到文件。
src/components/common/Sidebar.vue
浏览文件 @
78803890
...
@@ -77,6 +77,11 @@
...
@@ -77,6 +77,11 @@
icon
:
'
el-icon-warning
'
,
icon
:
'
el-icon-warning
'
,
index
:
'
permission
'
,
index
:
'
permission
'
,
title
:
'
权限测试
'
title
:
'
权限测试
'
},
{
icon
:
'
el-icon-error
'
,
index
:
'
404
'
,
title
:
'
404页面
'
}
}
]
]
}
}
...
...
src/components/page/403.vue
0 → 100644
浏览文件 @
78803890
<
template
>
<div
class=
"error-page"
>
<div
class=
"error-code"
>
4
<span>
0
</span>
3
</div>
<div
class=
"error-desc"
>
啊哦~ 你没有权限访问该页面哦
</div>
<div
class=
"error-handle"
>
<router-link
to=
"/readme"
>
<el-button
type=
"primary"
size=
"large"
>
返回首页
</el-button>
</router-link>
<el-button
class=
"error-btn"
type=
"primary"
size=
"large"
@
click=
"goBack"
>
返回上一页
</el-button>
</div>
</div>
</
template
>
<
script
>
export
default
{
methods
:
{
goBack
(){
this
.
$router
.
go
(
-
1
);
}
}
}
</
script
>
<
style
scoped
>
.error-page
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
flex-direction
:
column
;
width
:
100%
;
height
:
100%
;
background
:
#f3f3f3
;
box-sizing
:
border-box
;
}
.error-code
{
line-height
:
1
;
font-size
:
250px
;
font-weight
:
bolder
;
color
:
#f02d2d
;
}
.error-code
span
{
color
:
#00a854
;
}
.error-desc
{
font-size
:
30px
;
color
:
#777
;
}
.error-handle
{
margin-top
:
30px
;
padding-bottom
:
200px
;
}
.error-btn
{
margin-left
:
100px
;
}
</
style
>
src/components/page/404.vue
浏览文件 @
78803890
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<div
class=
"error-code"
>
4
<span>
0
</span>
4
</div>
<div
class=
"error-code"
>
4
<span>
0
</span>
4
</div>
<div
class=
"error-desc"
>
啊哦~ 你所访问的页面不存在
</div>
<div
class=
"error-desc"
>
啊哦~ 你所访问的页面不存在
</div>
<div
class=
"error-handle"
>
<div
class=
"error-handle"
>
<router-link
to=
"/"
>
<router-link
to=
"/
readme
"
>
<el-button
type=
"primary"
size=
"large"
>
返回首页
</el-button>
<el-button
type=
"primary"
size=
"large"
>
返回首页
</el-button>
</router-link>
</router-link>
<el-button
class=
"error-btn"
type=
"primary"
size=
"large"
@
click=
"goBack"
>
返回上一页
</el-button>
<el-button
class=
"error-btn"
type=
"primary"
size=
"large"
@
click=
"goBack"
>
返回上一页
</el-button>
...
...
src/components/page/Permission.vue
浏览文件 @
78803890
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
</div>
</div>
<div
class=
"container"
>
<div
class=
"container"
>
<h1>
管理员权限页面
</h1>
<h1>
管理员权限页面
</h1>
<p>
只有用 admin 账号登录的才拥有管理员权限,才能进到这个页面,其他账号想进来都会跳到
登录
页面,重新用管理员账号登录才有权限。
</p>
<p>
只有用 admin 账号登录的才拥有管理员权限,才能进到这个页面,其他账号想进来都会跳到
403
页面,重新用管理员账号登录才有权限。
</p>
<p>
想尝试一下,请
<router-link
to=
"/login"
class=
"logout"
>
退出登录
</router-link>
,随便输入个账号名,再进来试试看。
</p>
<p>
想尝试一下,请
<router-link
to=
"/login"
class=
"logout"
>
退出登录
</router-link>
,随便输入个账号名,再进来试试看。
</p>
</div>
</div>
...
...
src/main.js
浏览文件 @
78803890
...
@@ -15,7 +15,7 @@ router.beforeEach((to, from, next) => {
...
@@ -15,7 +15,7 @@ router.beforeEach((to, from, next) => {
if
(
to
.
meta
.
permission
){
if
(
to
.
meta
.
permission
){
const
role
=
localStorage
.
getItem
(
'
ms_username
'
);
const
role
=
localStorage
.
getItem
(
'
ms_username
'
);
// 如果是管理员权限则可进入,这里只是简单的模拟管理员权限而已
// 如果是管理员权限则可进入,这里只是简单的模拟管理员权限而已
role
===
'
admin
'
?
next
()
:
next
(
'
/
login
'
);
role
===
'
admin
'
?
next
()
:
next
(
'
/
403
'
);
}
else
{
}
else
{
// 简单的判断IE10及以下不进入富文本编辑器,该组件不兼容
// 简单的判断IE10及以下不进入富文本编辑器,该组件不兼容
if
(
navigator
.
userAgent
.
indexOf
(
'
MSIE
'
)
>
-
1
&&
to
.
path
===
'
/editor
'
){
if
(
navigator
.
userAgent
.
indexOf
(
'
MSIE
'
)
>
-
1
&&
to
.
path
===
'
/editor
'
){
...
...
src/router/index.js
浏览文件 @
78803890
...
@@ -75,5 +75,13 @@ export default new Router({
...
@@ -75,5 +75,13 @@ export default new Router({
path
:
'
/404
'
,
path
:
'
/404
'
,
component
:
resolve
=>
require
([
'
../components/page/404.vue
'
],
resolve
)
component
:
resolve
=>
require
([
'
../components/page/404.vue
'
],
resolve
)
},
},
{
path
:
'
/403
'
,
component
:
resolve
=>
require
([
'
../components/page/403.vue
'
],
resolve
)
},
{
path
:
'
*
'
,
redirect
:
'
/404
'
}
]
]
})
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录