Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
7265f1ce
提交
7265f1ce
authored
5月 06, 2020
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bug fixes
上级
a58da42f
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
38 行增加
和
16 行删除
+38
-16
course_api.js
client/src/api/course_api.js
+2
-2
Before.js
client/src/components/beforeEnter/Before.js
+33
-13
courseDetail.vue
client/src/pages/learn/courseDetail.vue
+2
-0
routes.js
client/src/router/routes.js
+1
-1
没有找到文件。
client/src/api/course_api.js
浏览文件 @
7265f1ce
...
...
@@ -28,11 +28,11 @@ export default class CourseAPI extends BaseAPI {
* @param {[string]} cid
* @param {[string]} sid
*/
selectCourse
=
(
cid
,
sid
)
=>
this
.
post
(
'/v2/education/courses/major'
,
{
course_id
:
cid
,
semester_id
:
sid
})
selectCourse
=
(
cid
,
sid
)
=>
this
.
post
(
'/v2/education/courses/major'
,
{
course_id
:
cid
,
semester_id
:
sid
}
,
{
headers
:
{
'Content-Type'
:
'application/json'
}
}
)
/**
* 退课
* @param {[string]} cid
* @param {[string]} sid
*/
outSelectCourse
=
(
cid
,
sid
)
=>
this
.
post
(
'/v2/education/courses/drop'
,
{
course_id
:
cid
,
semester_id
:
sid
})
outSelectCourse
=
(
cid
,
sid
)
=>
this
.
post
(
'/v2/education/courses/drop'
,
{
course_id
:
cid
,
semester_id
:
sid
}
,
{
headers
:
{
'Content-Type'
:
'application/json'
}
}
)
}
client/src/components/beforeEnter/Before.js
浏览文件 @
7265f1ce
...
...
@@ -3,32 +3,52 @@ import cAction from '@action'
import
{
Message
}
from
'element-ui'
export
default
class
Before
{
constructor
(
opt
)
{
constructor
(
opt
)
{
const
UA
=
navigator
.
userAgent
this
.
opt
=
opt
||
{}
// 免登录列表
this
.
whiteList
=
[
'login-normal'
,
'login-code'
,
'login-forget'
,
'studentHelp'
,
'teacherHelp'
]
this
.
isMobile
=
/android|iphone|ipad|ipod/i
.
test
(
UA
)
}
async
update
(
to
,
from
,
next
)
{
if
(
to
.
name
===
'studentHelp'
||
to
.
name
===
'teacherHelp'
)
{
async
update
(
to
,
from
,
next
)
{
// 免登录页面
if
(
this
.
whiteList
.
includes
(
to
.
name
))
{
next
()
}
else
if
(
to
.
name
!==
'login-normal'
&&
to
.
name
!==
'login-code'
&&
to
.
name
!==
'login-forget'
)
{
// 所有登录页 不进行登录校验
return
}
// 检测登录状态
const
isLogin
=
await
this
.
isLogin
()
if
(
isLogin
)
{
next
()
}
else
{
next
({
path
:
'/login/index?rd='
+
encodeURIComponent
(
to
.
fullPath
)
})
// 需要传参并再传回来
if
(
!
isLogin
)
{
next
({
path
:
'/login/index'
,
query
:
{
rd
:
encodeURIComponent
(
to
.
fullPath
)
}
})
return
}
}
else
{
next
()
// 移动端
if
(
this
.
isMobile
&&
to
.
name
!==
'mobileIndex'
)
{
next
({
path
:
'/mobile/list'
})
return
}
next
()
}
/* 获取用户信息 */
isLogin
()
{
isLogin
()
{
if
(
window
.
G
.
UserInfo
)
return
true
return
cAction
.
Other
.
getInfo
().
then
(
res
=>
{
return
cAction
.
Other
.
getInfo
()
.
then
((
res
)
=>
{
window
.
G
.
UserInfo
=
res
return
true
}).
catch
(
res
=>
{
})
.
catch
((
res
)
=>
{
if
(
res
.
code
!==
80201
)
{
Message
({
type
:
'error'
,
message
:
res
.
message
})
}
...
...
client/src/pages/learn/courseDetail.vue
浏览文件 @
7265f1ce
...
...
@@ -4,6 +4,7 @@
<div
class=
"detail-box"
>
<div
class=
"box-thd"
>
<div
class=
"title"
@
click=
"noWantThisCourse"
>
{{
headerInfo
.
title
}}
<template
v-if=
"tabs[1].chapterList.course[0].chapters[0].vid"
>
<template
v-if=
'headerInfo.isStart && tabs[1].chapterList.currentChapterId'
>
<el-button
class=
"rbtn"
type=
"primary"
size=
"mini"
@
click=
'startLearn'
:data-cid=
'cid'
:data-sid=
'sid'
:data-type=
'tabs[1].chapterList.currentVideoProvider'
:data-vid=
'tabs[1].chapterList.currentChapterId'
>
继续学习
</el-button>
</
template
>
...
...
@@ -13,6 +14,7 @@
<
template
v-else
>
<el-button
class=
"rbtn"
type=
"primary"
size=
"mini"
@
click=
'wantThisCourse'
>
选课
</el-button>
</
template
>
</template>
</div>
<div
class=
"tags"
>
<
template
v-for=
"(item1, index) in headerInfo.arrTab"
>
...
...
client/src/router/routes.js
浏览文件 @
7265f1ce
...
...
@@ -250,7 +250,7 @@ export default [
},
{
path
:
'list'
,
name
:
'
list
'
,
name
:
'
mobileIndex
'
,
component
:
()
=>
import
(
'@/pages/mobileLive/list.vue'
),
props
:
true
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论