Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-admin-consultation
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-admin-consultation
提交
1537f12d
提交
1537f12d
编写于
3月 14, 2019
作者:
huangwensu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
获取菜单和用户信息
上级
c2e095e4
变更
6
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
103 行增加
和
86 行删除
+103
-86
App.vue
src/App.vue
+37
-3
fetch.js
src/utils/fetch.js
+4
-1
create-component.vue
src/views/education/create-component.vue
+5
-0
item-component.vue
src/views/education/item-component.vue
+4
-1
header.vue
src/views/layout/header.vue
+10
-17
slidebar.vue
src/views/layout/slidebar.vue
+43
-64
未找到文件。
src/App.vue
浏览文件 @
1537f12d
<
template
>
<
template
>
<div>
<div>
<v-header></v-header>
<v-header
:userName=
"userName"
:portrait=
"portrait"
></v-header>
<v-slidebar></v-slidebar>
<v-slidebar
:authList=
"authList"
:tokenValue=
"token"
></v-slidebar>
<el-container>
<el-container>
<div
class=
"content"
id=
"body-content"
>
<div
class=
"content"
id=
"body-content"
>
<transition
name=
"router-fade"
mode=
"out-in"
>
<transition
name=
"router-fade"
mode=
"out-in"
>
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
import
VHeader
from
'./views/layout/header.vue'
import
VHeader
from
'./views/layout/header.vue'
import
VSlidebar
from
'./views/layout/slidebar.vue'
import
VSlidebar
from
'./views/layout/slidebar.vue'
import
VFooter
from
'./views/layout/footer.vue'
import
VFooter
from
'./views/layout/footer.vue'
import
{
base64decode
}
from
"./utils/utils.js"
import
{
mapActions
}
from
'vuex'
let
vm
=
null
let
vm
=
null
export
default
{
export
default
{
components
:{
components
:{
...
@@ -31,11 +33,15 @@ export default {
...
@@ -31,11 +33,15 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
token
:
''
,
userName
:
''
,
portrait
:
''
,
authList
:
{}
}
}
},
},
created
()
{
created
()
{
vm
=
this
vm
=
this
vm
.
getToken
()
},
},
mounted
()
{
mounted
()
{
setInterval
(
function
(){
setInterval
(
function
(){
...
@@ -43,6 +49,18 @@ export default {
...
@@ -43,6 +49,18 @@ export default {
},
60000
)
},
60000
)
},
},
methods
:
{
methods
:
{
// 解密token
getToken
()
{
let
href
=
window
.
location
.
href
let
offset
=
href
.
indexOf
(
"?"
)
if
(
offset
!==
-
1
)
{
let
paramStr
=
href
.
substring
(
offset
+
1
,
href
.
length
)
let
pars
=
base64decode
(
paramStr
).
split
(
"&"
)[
0
].
split
(
"="
)[
1
]
vm
.
token
=
pars
}
vm
.
changeToken
(
vm
.
token
)
vm
.
getUserAuth
(
vm
.
token
)
},
// 实时消息推送
// 实时消息推送
pushMessage
()
{
pushMessage
()
{
vm
.
$notify
({
vm
.
$notify
({
...
@@ -50,6 +68,22 @@ export default {
...
@@ -50,6 +68,22 @@ export default {
message
:
'这是一条警告的提示消息'
,
message
:
'这是一条警告的提示消息'
,
type
:
'warning'
type
:
'warning'
});
});
},
// 修改token
...
mapActions
([
'changeToken'
,
'changeIdType'
]),
// 获取用户权限
getUserAuth
(
token
)
{
vm
.
GET
(
'common/v1/role'
,{
token
:
token
}).
then
((
res
)
=>
{
if
(
res
.
code
==
'000000'
)
{
vm
.
changeIdType
(
res
.
data
.
idType
)
vm
.
userName
=
res
.
data
.
name
vm
.
portrait
=
res
.
data
.
imageUrl
vm
.
authList
=
res
.
data
.
auth
}
})
}
}
}
}
}
}
...
...
src/utils/fetch.js
浏览文件 @
1537f12d
...
@@ -11,8 +11,11 @@ const service = axios.create({
...
@@ -11,8 +11,11 @@ const service = axios.create({
// request拦截器
// request拦截器
service
.
interceptors
.
request
.
use
(
config
=>
{
service
.
interceptors
.
request
.
use
(
config
=>
{
if
(
config
.
data
&&
config
.
data
.
token
)
{
localStorage
.
setItem
(
'storageToken'
,
config
.
data
.
token
)
}
config
.
headers
[
'sysCode'
]
=
12
config
.
headers
[
'sysCode'
]
=
12
config
.
headers
[
'token'
]
=
'AB14D7D7675E4D09B4B1566170076122'
config
.
headers
[
'token'
]
=
localStorage
.
getItem
(
'storageToken'
)
config
.
headers
[
'deviceInfo'
]
=
JSON
.
stringify
({
"app_channel"
:
""
,
"app_mac"
:
""
,
"app_uuid"
:
""
,
"app_version"
:
""
,
"device_brand"
:
""
,
"device_ip"
:
""
,
"device_model"
:
""
,
"device_net"
:
""
,
"device_ops"
:
""
,
"resolution_wh"
:
""
,
"system_level"
:
""
,
"device_type"
:
'10'
})
config
.
headers
[
'deviceInfo'
]
=
JSON
.
stringify
({
"app_channel"
:
""
,
"app_mac"
:
""
,
"app_uuid"
:
""
,
"app_version"
:
""
,
"device_brand"
:
""
,
"device_ip"
:
""
,
"device_model"
:
""
,
"device_net"
:
""
,
"device_ops"
:
""
,
"resolution_wh"
:
""
,
"system_level"
:
""
,
"device_type"
:
'10'
})
// if (config.data && config.data.setEntry) {
// if (config.data && config.data.setEntry) {
// config.headers['sysCode'] = config.data.sysCode || 10
// config.headers['sysCode'] = config.data.sysCode || 10
...
...
src/views/education/create-component.vue
浏览文件 @
1537f12d
...
@@ -287,6 +287,7 @@ import BreadCrumb from '../../components/breadcrumb.vue'
...
@@ -287,6 +287,7 @@ import BreadCrumb from '../../components/breadcrumb.vue'
import
{
doUpload
,
getFilePath
}
from
"../../utils/qiniuUtil"
import
{
doUpload
,
getFilePath
}
from
"../../utils/qiniuUtil"
import
{
validateWord150
}
from
"../../utils/validate.js"
import
{
validateWord150
}
from
"../../utils/validate.js"
import
{
mapGetters
}
from
'vuex'
import
{
mapGetters
}
from
'vuex'
import
{
openLoading
,
closeLoading
}
from
'../../utils/utils'
;
let
vm
=
null
let
vm
=
null
// 判断组件是否重名
// 判断组件是否重名
let
validateRepeatWord
=
function
(
rule
,
value
,
callback
,
message
)
{
let
validateRepeatWord
=
function
(
rule
,
value
,
callback
,
message
)
{
...
@@ -462,7 +463,9 @@ export default {
...
@@ -462,7 +463,9 @@ export default {
// 根据ID查询组件基本信息
// 根据ID查询组件基本信息
componentBasicInfo
()
{
componentBasicInfo
()
{
if
(
vm
.
componentId
)
{
if
(
vm
.
componentId
)
{
openLoading
(
vm
)
vm
.
GET
(
'portalComponent/queryPortalComponentById'
,{
id
:
vm
.
componentId
}).
then
((
res
)
=>
{
vm
.
GET
(
'portalComponent/queryPortalComponentById'
,{
id
:
vm
.
componentId
}).
then
((
res
)
=>
{
closeLoading
(
vm
)
if
(
res
.
code
==
'000000'
)
{
if
(
res
.
code
==
'000000'
)
{
vm
.
portalComponent
=
res
.
data
.
portalComponent
vm
.
portalComponent
=
res
.
data
.
portalComponent
vm
.
itemName
=
vm
.
portalComponent
.
name
vm
.
itemName
=
vm
.
portalComponent
.
name
...
@@ -567,7 +570,9 @@ export default {
...
@@ -567,7 +570,9 @@ export default {
if
(
_this
.
width
!=
750
||
_this
.
height
!=
420
)
{
if
(
_this
.
width
!=
750
||
_this
.
height
!=
420
)
{
vm
.
$message
.
info
(
'图片不符合规范,请根据规范上传图片'
)
vm
.
$message
.
info
(
'图片不符合规范,请根据规范上传图片'
)
}
else
{
}
else
{
openLoading
(
vm
)
doUpload
(
vm
,
file
,
getFilePath
(
file
,
null
),
'preview4'
,
'progress1'
,
1
).
then
(
function
(
path
)
{
doUpload
(
vm
,
file
,
getFilePath
(
file
,
null
),
'preview4'
,
'progress1'
,
1
).
then
(
function
(
path
)
{
closeLoading
(
vm
)
vm
.
portalComponent
.
imageUrl
=
path
.
fullPath
vm
.
portalComponent
.
imageUrl
=
path
.
fullPath
});
});
}
}
...
...
src/views/education/item-component.vue
浏览文件 @
1537f12d
...
@@ -73,6 +73,7 @@ import BreadCrumb from '../../components/breadcrumb.vue'
...
@@ -73,6 +73,7 @@ import BreadCrumb from '../../components/breadcrumb.vue'
import
{
doUpload
,
getFilePath
}
from
"../../utils/qiniuUtil"
import
{
doUpload
,
getFilePath
}
from
"../../utils/qiniuUtil"
import
{
validateWord
}
from
"../../utils/validate.js"
import
{
validateWord
}
from
"../../utils/validate.js"
import
{
mapGetters
}
from
'vuex'
import
{
mapGetters
}
from
'vuex'
import
{
openLoading
,
closeLoading
}
from
'../../utils/utils'
;
let
vm
=
null
let
vm
=
null
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -133,7 +134,9 @@ export default {
...
@@ -133,7 +134,9 @@ export default {
methods
:
{
methods
:
{
// 列表查询
// 列表查询
search
()
{
search
()
{
vm
.
GET
(
'/portalComponent/queryPortalComponent'
,
vm
.
searchParam
).
then
((
res
)
=>
{
openLoading
(
vm
)
vm
.
GET
(
'portalComponent/queryPortalComponent'
,
vm
.
searchParam
).
then
((
res
)
=>
{
closeLoading
(
vm
)
if
(
res
.
code
==
'000000'
)
{
if
(
res
.
code
==
'000000'
)
{
vm
.
tableData
=
res
.
data
.
queryList
vm
.
tableData
=
res
.
data
.
queryList
vm
.
totalRows
=
res
.
data
.
total
vm
.
totalRows
=
res
.
data
.
total
...
...
src/views/layout/header.vue
浏览文件 @
1537f12d
...
@@ -7,34 +7,27 @@
...
@@ -7,34 +7,27 @@
<div
class=
"user-info"
>
<div
class=
"user-info"
>
<el-dropdown
trigger=
"click"
@
command=
"handleCommand"
>
<el-dropdown
trigger=
"click"
@
command=
"handleCommand"
>
<div
class=
"el-dropdown-link"
>
<div
class=
"el-dropdown-link"
>
<img
class=
"user-logo"
src=
"../../assets/image/img.jpg
"
>
<img
class=
"user-logo"
:src=
"portrait
"
>
<span
id=
"headName"
>
{{
n
ame
}}
</span><i
class=
"el-icon-caret-bottom"
></i>
<span
id=
"headName"
>
{{
userN
ame
}}
</span><i
class=
"el-icon-caret-bottom"
></i>
</div>
</div>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-menu
slot=
"dropdown"
>
<!--
<el-dropdown-item
command=
"logout"
>
退出
</el-dropdown-item>
-->
<el-dropdown-item
command=
"logout"
>
注销
</el-dropdown-item>
<el-dropdown-item
command=
"logout"
>
注销
</el-dropdown-item>
<el-dropdown-item
@
click=
"forward"
>
返回云鹊医首页
</el-dropdown-item>
<el-dropdown-item
@
click=
"forward"
>
返回云鹊医首页
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown>
</div>
</div>
<!--导航-->
<!--
<div
class=
"user-info"
style=
"padding-right:10px;"
>
<el-dropdown
trigger=
"click"
@
command=
"handleCommand"
>
<div>
<span
class=
"el-dropdown-link"
>
返回云鹊医首页
</span>
<span
class=
"line"
>
|
</span>
</div>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"logout"
>
注销
</el-dropdown-item>
<el-dropdown-item
@
click=
"forward"
>
返回云鹊医首页
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
-->
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
props
:
{
portrait
:
{
type
:
String
},
userName
:
{
type
:
String
}
},
data
()
{
data
()
{
return
{
return
{
name
:
'hws'
,
name
:
'hws'
,
...
...
src/views/layout/slidebar.vue
浏览文件 @
1537f12d
...
@@ -21,47 +21,23 @@
...
@@ -21,47 +21,23 @@
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
mapActions
}
from
'vuex'
import
{
mapGetters
}
from
'vuex'
import
{
setTimeout
}
from
'timers'
;
let
vm
=
null
let
vm
=
null
export
default
{
export
default
{
props
:
{
tokenValue
:
{
type
:
String
},
authList
:
{
type
:
Object
,
default
:
()
=>
{}
}
},
data
()
{
data
()
{
return
{
return
{
token
:
''
,
// authList: {},
authList
:
{},
items
:
[]
items
:
[
{
title
:
'数据总览'
,
icon
:
'el-icon-menu'
,
index
:
'home'
},{
title
:
'教培项目'
,
icon
:
'el-icon-message'
,
index
:
'item'
,
subs
:
[
{
title
:
'项目组件'
,
icon
:
'el-icon-setting'
,
index
:
'item-component'
},
{
title
:
'项目管理'
,
icon
:
'el-icon-setting'
,
index
:
'item-manager'
}
]
},{
title
:
'系统管理'
,
icon
:
'el-icon-menu'
,
index
:
'system'
,
subs
:
[
{
title
:
'角色管理'
,
icon
:
'el-icon-setting'
,
index
:
'role'
}
]
}
]
}
}
},
},
computed
:
{
computed
:
{
...
@@ -71,36 +47,39 @@ export default {
...
@@ -71,36 +47,39 @@ export default {
},
},
created
()
{
created
()
{
vm
=
this
vm
=
this
vm
.
token
=
vm
.
$route
.
query
.
token
||
'C1C5360EEC754092B9EC244147B35BB7'
vm
.
authSelect
()
vm
.
changeToken
(
vm
.
token
)
vm
.
getUserAuth
(
vm
.
token
)
},
mounted
()
{
},
},
methods
:
{
methods
:
{
// 修改token
// 获取菜单数据
...
mapActions
([
authSelect
()
{
'changeToken'
,
let
req
=
{
'changeIdType'
"token"
:
vm
.
tokenValue
,
]),
"system_type"
:
"25"
// 获取用户权限
}
getUserAuth
(
token
)
{
vm
.
POST
(
'portalComponent/menu/list'
,
req
).
then
((
res
)
=>
{
vm
.
GET
(
'common/v1/role'
,{
token
:
token
}).
then
((
res
)
=>
{
if
(
res
.
code
==
'000000'
)
{
if
(
res
.
code
==
'000000'
)
{
vm
.
items
=
res
.
data
.
picapMenuModels
vm
.
changeIdType
(
res
.
data
.
idType
)
vm
.
$nextTick
(()
=>
{
vm
.
authList
=
res
.
data
.
auth
vm
.
getUserAuth
()
if
(
!
vm
.
authList
.
P001
)
{
// 项目管理
})
vm
.
items
[
1
].
subs
[
1
].
index
=
'blank'
}
}
if
(
!
vm
.
authList
.
P002
)
{
// 组件管理
})
vm
.
items
[
1
].
subs
[
0
].
index
=
'blank'
},
}
// 获取用户权限
if
(
!
vm
.
authList
.
P001
)
{
// 角色管理
getUserAuth
()
{
vm
.
items
[
2
].
subs
[
0
].
index
=
'blank'
if
(
vm
.
authList
&&
vm
.
authList
.
length
>
0
)
{
}
if
(
!
vm
.
authList
.
P001
)
{
// 项目管理
}
vm
.
items
[
1
].
subs
[
1
].
index
=
'blank'
})
}
if
(
!
vm
.
authList
.
P002
)
{
// 组件管理
vm
.
items
[
1
].
subs
[
0
].
index
=
'blank'
}
if
(
!
vm
.
authList
.
P001
)
{
// 角色管理
vm
.
items
[
2
].
subs
[
0
].
index
=
'blank'
}
}
}
}
}
}
}
}
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录