Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
c717eaba
提交
c717eaba
authored
11月 04, 2020
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加课程播放页面
上级
1ef40519
隐藏空白字符变更
内嵌
并排
正在显示
24 个修改的文件
包含
114 行增加
和
121 行删除
+114
-121
.config.dev.js
.config.dev.js
+1
-1
.config.pro.js
.config.pro.js
+1
-1
.config.test.js
.config.test.js
+1
-1
.eslintrc
.eslintrc
+2
-1
course.js
src/api/course.js
+7
-1
AppSearchBar.vue
src/components/AppSearchBar.vue
+1
-0
CourseList.vue
src/components/CourseList.vue
+1
-1
index.html
src/index.html
+3
-4
main.js
src/main.js
+1
-3
index.js
src/modules/index.js
+1
-2
api.js
src/modules/viewer/api.js
+27
-45
index.vue
src/modules/viewer/components/aside/index.vue
+2
-2
chapterLive.vue
src/modules/viewer/components/live/chapterLive.vue
+1
-1
chapterPlayer.vue
src/modules/viewer/components/player/chapterPlayer.vue
+5
-5
index.vue
src/modules/viewer/index.vue
+2
-15
routes.js
src/modules/viewer/routes.js
+2
-8
password.vue
src/pages/account/password.vue
+4
-4
item.vue
src/pages/course/learn/item.vue
+3
-1
index.vue
src/pages/course/tag/index.vue
+22
-12
item.vue
src/pages/course/tag/item.vue
+6
-1
routes.js
src/router/routes.js
+3
-1
index.js
src/store/index.js
+0
-7
style.scss
src/style.scss
+10
-0
axios.js
src/utils/axios.js
+8
-4
没有找到文件。
.config.dev.js
浏览文件 @
c717eaba
...
...
@@ -33,6 +33,6 @@ module.exports = {
},
ProvidePlugin
:
{},
others
:
{
WECHAT_REDIRECT_URL
:
'https://passport2.ezijing.com
'
loginUrl
:
'https://login2.ezijing.com/xlearn/login/index
'
}
}
.config.pro.js
浏览文件 @
c717eaba
...
...
@@ -14,6 +14,6 @@ module.exports = {
},
ProvidePlugin
:
{},
others
:
{
WECHAT_REDIRECT_URL
:
'https://passport.ezijing.com
'
loginUrl
:
'https://login.ezijing.com/xlearn/login/index
'
}
}
.config.test.js
浏览文件 @
c717eaba
...
...
@@ -14,6 +14,6 @@ module.exports = {
},
ProvidePlugin
:
{},
others
:
{
WECHAT_REDIRECT_URL
:
'https://passport2.ezijing.com
'
loginUrl
:
'https://login2.ezijing.com/xlearn/login/index
'
}
}
.eslintrc
浏览文件 @
c717eaba
...
...
@@ -19,6 +19,7 @@
"window": false,
"webConf": false,
"wx": false,
"WeixinJSBridge": false
"WeixinJSBridge": false,
"Aliplayer": false
}
}
src/api/course.js
浏览文件 @
c717eaba
...
...
@@ -18,7 +18,13 @@ export function getCourseList() {
* @param {string} courseId 课程ID
*/
export
function
getCourse
(
courseId
)
{
return
httpRequest
.
get
(
`/api/zy/v2/education/courses/
${
courseId
}
`
)
return
httpRequest
.
get
(
`/api/zy/v2/education/courses/
${
courseId
}
`
).
then
(
response
=>
{
response
.
chapters
=
response
.
chapters
.
filter
(
item
=>
{
item
.
children
=
item
.
children
.
filter
(
child
=>
child
.
type
===
2
)
return
item
.
children
.
length
})
return
response
})
}
/**
...
...
src/components/AppSearchBar.vue
浏览文件 @
c717eaba
...
...
@@ -55,6 +55,7 @@ export default {
<
style
lang=
"scss"
>
.search-bar
{
display
:
flex
;
align-items
:
center
;
.el-input
{
width
:
240px
;
...
...
src/components/CourseList.vue
浏览文件 @
c717eaba
...
...
@@ -5,7 +5,7 @@
</
template
>
<
template
v-else
>
<slot
name=
"empty"
>
<div
class=
"empty"
>
暂无
内容
</div>
<div
class=
"empty"
>
暂无
相关课程
</div>
</slot>
</
template
>
</div>
...
...
src/index.html
浏览文件 @
c717eaba
...
...
@@ -13,12 +13,11 @@
id=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no, viewport-fit=cover"
/>
<link
rel=
"stylesheet"
href=
"https://g.alicdn.com/de/prismplayer/2.9.1/skins/default/aliplayer-min.css"
/>
</head>
<body>
<div
id=
"app"
></div>
<script
type=
"text/javascript"
src=
"https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/common/runtime.js"
></script>
<script
src=
"https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/common/runtime.js"
></script>
<script
src=
"https://g.alicdn.com/de/prismplayer/2.9.1/aliplayer-min.js"
></script>
</body>
</html>
src/main.js
浏览文件 @
c717eaba
...
...
@@ -2,11 +2,9 @@ import Vue from 'vue'
import
router
from
'./router'
import
store
from
'./store'
import
App
from
'./app.vue'
import
'./style.scss'
import
ElementUI
from
'element-ui'
import
'element-ui/lib/theme-chalk/index.css'
import
'./style.scss'
import
BeforeEnter
from
'./utils/beforeEnter'
const
before
=
new
BeforeEnter
()
...
...
src/modules/index.js
浏览文件 @
c717eaba
/* Automatically generated by './build/bin/build-entry.js' */
/* 模块基于 element-ui,一定在 element-ui后加载 */
import
ExamModule
from
'./exam-module'
const
components
=
[
ExamModule
]
const
install
=
function
(
Vue
,
opts
=
{})
{
const
install
=
function
(
Vue
,
opts
=
{})
{
components
.
forEach
(
component
=>
{
Vue
.
use
(
component
,
opts
)
})
...
...
src/modules/viewer/api.js
浏览文件 @
c717eaba
import
BaseAPI
from
'@/api/base_api'
const
httpRequest
=
new
BaseAPI
(
webConf
)
import
httpRequest
from
'@/utils/axios'
/**
* 获取课程详情
...
...
@@ -8,9 +6,13 @@ const httpRequest = new BaseAPI(webConf)
* @param {string} courseId 课程ID
*/
export
function
getCourse
(
semesterId
,
courseId
)
{
return
httpRequest
.
get
(
`/api/lms/v2/education/courses/
${
semesterId
}
/
${
courseId
}
`
)
return
httpRequest
.
get
(
`/api/zy/v2/education/courses/
${
courseId
}
`
).
then
(
response
=>
{
response
.
chapters
=
response
.
chapters
.
filter
(
item
=>
{
item
.
children
=
item
.
children
.
filter
(
child
=>
child
.
type
===
2
)
return
item
.
children
.
length
})
return
response
})
}
/**
...
...
@@ -19,7 +21,7 @@ export function getCourse(semesterId, courseId) {
*/
export
function
getChapterVideo
(
vid
)
{
return
httpRequest
.
post
(
'/api/
lms
/v2/education/video-streaming'
,
'/api/
zy
/v2/education/video-streaming'
,
{
vid
},
{
headers
:
{
'Content-Type'
:
'application/json'
}
}
)
...
...
@@ -31,7 +33,7 @@ export function getChapterVideo(vid) {
*/
export
function
getChapterVideoAliyun
(
vid
)
{
return
httpRequest
.
post
(
'/api/
lms
/v2/education/aliyun-video-streaming'
,
'/api/
zy
/v2/education/aliyun-video-streaming'
,
{
vid
},
{
headers
:
{
'Content-Type'
:
'application/json'
}
}
)
...
...
@@ -44,10 +46,7 @@ export function getChapterVideoAliyun(vid) {
* @param {Object} params
*/
export
function
getChapterVideoProgress
(
semesterId
,
resourseId
,
params
)
{
return
httpRequest
.
get
(
`/api/lms/v2/education/video/
${
semesterId
}
/
${
resourseId
}
/device`
,
params
)
return
httpRequest
.
get
(
`/api/zy/v2/education/video/
${
resourseId
}
/device`
,
{
params
})
}
/**
...
...
@@ -55,7 +54,7 @@ export function getChapterVideoProgress(semesterId, resourseId, params) {
* @param {Object} params
*/
export
function
updateChapterVideoProgress
(
params
)
{
return
httpRequest
.
get
(
'/api/
lms/v2/analytics/upload-video'
,
params
)
return
httpRequest
.
get
(
'/api/
zy/v2/analytics/upload-video'
,
{
params
}
)
}
/**
...
...
@@ -65,9 +64,7 @@ export function updateChapterVideoProgress(params) {
* @param {string} resourseId 章节的资源ID
*/
export
function
getChapterHomework
(
semesterId
,
courseId
,
resourseId
)
{
return
httpRequest
.
get
(
`/api/lms/v2/education/homeworks/
${
semesterId
}
/
${
courseId
}
/
${
resourseId
}
`
)
return
httpRequest
.
get
(
`/api/zy/v2/education/homeworks/
${
courseId
}
/
${
resourseId
}
`
)
}
/**
...
...
@@ -77,16 +74,14 @@ export function getChapterHomework(semesterId, courseId, resourseId) {
* @param {string} chapterId 章节ID
*/
export
function
getChapterHomeworkDeadline
(
semesterId
,
courseId
,
chapterId
)
{
return
httpRequest
.
get
(
`/api/lms/v2/education/homeworks/
${
semesterId
}
/
${
courseId
}
/
${
chapterId
}
/deadline`
)
return
httpRequest
.
get
(
`/api/zy/v2/education/homeworks/
${
courseId
}
/
${
chapterId
}
/deadline`
)
}
/**
* 提交考试
*/
export
function
sbumitChapterHomework
(
params
)
{
return
httpRequest
.
post
(
'/api/
lms/v2/education/homeworks'
,
params
,
{
export
function
sbumitChapterHomework
(
data
)
{
return
httpRequest
.
post
(
'/api/
zy/v2/education/homeworks'
,
data
,
{
headers
:
{
'Content-Type'
:
'application/json'
}
})
}
...
...
@@ -95,7 +90,7 @@ export function sbumitChapterHomework(params) {
* 上传文件
*/
export
function
uploadFile
(
data
)
{
return
httpRequest
.
post
(
'/api/
lms
/util/upload-file'
,
data
,
{
return
httpRequest
.
post
(
'/api/
zy
/util/upload-file'
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
...
...
@@ -106,9 +101,7 @@ export function uploadFile(data) {
* @param {string} courseId 课程ID
*/
export
function
getCourseWork
(
semesterId
,
courseId
)
{
return
httpRequest
.
get
(
`/api/lms/v2/education/courses/
${
semesterId
}
/
${
courseId
}
/essay`
)
return
httpRequest
.
get
(
`/api/zy/v2/education/courses/
${
courseId
}
/essay`
)
}
/**
...
...
@@ -117,11 +110,9 @@ export function getCourseWork(semesterId, courseId) {
* @param {string} courseId 课程ID
*/
export
function
updateCourseWork
(
semesterId
,
courseId
,
data
)
{
return
httpRequest
.
post
(
`/api/lms/v2/education/courses/
${
semesterId
}
/
${
courseId
}
/essay`
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
}
)
return
httpRequest
.
post
(
`/api/zy/v2/education/courses/
${
courseId
}
/essay`
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
/**
...
...
@@ -130,9 +121,7 @@ export function updateCourseWork(semesterId, courseId, data) {
* @param {string} courseId 课程ID
*/
export
function
getCourseExam
(
semesterId
,
courseId
)
{
return
httpRequest
.
get
(
`/api/lms/v2/education/
${
semesterId
}
/
${
courseId
}
/examination`
)
return
httpRequest
.
get
(
`/api/zy/v2/education/
${
courseId
}
/examination`
)
}
/**
...
...
@@ -142,9 +131,7 @@ export function getCourseExam(semesterId, courseId) {
* @param {string} examId 试题ID
*/
export
function
getCourseExamStatus
(
semesterId
,
courseId
,
examId
)
{
return
httpRequest
.
get
(
`/api/lms/v2/education/
${
semesterId
}
/
${
courseId
}
/examination/
${
examId
}
/status`
)
return
httpRequest
.
get
(
`/api/zy/v2/education/
${
courseId
}
/examination/
${
examId
}
/status`
)
}
/**
...
...
@@ -154,11 +141,9 @@ export function getCourseExamStatus(semesterId, courseId, examId) {
* @param {string} examId 试题ID
*/
export
function
submitCourseExam
(
semesterId
,
courseId
,
examId
,
data
)
{
return
httpRequest
.
post
(
`/api/lms/v2/education/
${
semesterId
}
/
${
courseId
}
/examination/
${
examId
}
/sheet`
,
data
,
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
}
)
return
httpRequest
.
post
(
`/api/zy/v2/education/
${
courseId
}
/examination/
${
examId
}
/sheet`
,
data
,
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
}
/**
...
...
@@ -168,8 +153,5 @@ export function submitCourseExam(semesterId, courseId, examId, data) {
* @param {string} examId 试题ID
*/
export
function
getCourseExamResult
(
semesterId
,
courseId
,
examId
,
params
)
{
return
httpRequest
.
get
(
`/api/lms/v2/education/
${
semesterId
}
/
${
courseId
}
/examination/
${
examId
}
/sheet`
,
params
)
return
httpRequest
.
get
(
`/api/zy/v2/education/
${
courseId
}
/examination/
${
examId
}
/sheet`
,
{
params
})
}
src/modules/viewer/components/aside/index.vue
浏览文件 @
c717eaba
<
template
>
<aside
class=
"course-viewer-aside"
>
<el-tabs
v-model=
"activeName"
>
<el-tab-pane
label=
"章节"
name=
"0"
>
<el-tab-pane
label=
"章节
列表
"
name=
"0"
>
<div
class=
"tab-pane"
>
<aside-chapter
:data=
"data"
:chapters=
"chapters"
:active=
"active"
></aside-chapter>
</div>
</el-tab-pane>
<el-tab-pane
label=
"
讲义
"
name=
"1"
v-if=
"active && active.type === 2"
>
<el-tab-pane
label=
"
学习资料
"
name=
"1"
v-if=
"active && active.type === 2"
>
<div
class=
"tab-pane"
>
<aside-lecture
:ppts=
"ppts"
:pptIndex=
"pptIndex"
v-on=
"$listeners"
></aside-lecture>
</div>
...
...
src/modules/viewer/components/live/chapterLive.vue
浏览文件 @
c717eaba
...
...
@@ -36,7 +36,7 @@ export default {
},
computed
:
{
user
()
{
return
window
.
G
.
UserInfo
?
window
.
G
.
UserInfo
.
student_info
:
{}
return
this
.
$store
.
state
.
user
},
nickName
()
{
return
this
.
user
.
personal_name
||
'匿名'
...
...
src/modules/viewer/components/player/chapterPlayer.vue
浏览文件 @
c717eaba
...
...
@@ -34,7 +34,6 @@
</
template
>
<
script
>
import
Cookies
from
'js-cookie'
import
{
throttle
}
from
'lodash'
// api
import
*
as
api
from
'../../api'
...
...
@@ -57,6 +56,7 @@ export default {
// 是否跳过片头
const
isSkip
=
window
.
localStorage
.
getItem
(
'isSkip'
)
===
'true'
return
{
deviceId
:
'jjhz92fn0.le2a6c06c9g0.thhg7ekb1f8'
,
videoVisible
:
true
,
pptVisible
:
false
,
isSkip
,
...
...
@@ -210,7 +210,7 @@ export default {
getChapterVideoProgress
()
{
api
.
getChapterVideoProgress
(
this
.
sid
,
this
.
resourceId
,
{
device_id
:
Cookies
.
get
(
'_idt'
)
device_id
:
this
.
deviceId
})
.
then
(
response
=>
{
this
.
progress
=
response
...
...
@@ -223,12 +223,12 @@ export default {
// 更新章节视频进度
updateChapterVideoProgress
(
time
,
durations
)
{
// 登录用户信息
const
user
=
window
.
G
.
UserInfo
const
user
=
this
.
$store
.
state
.
user
const
params
=
{
sid
:
user
.
student_info
.
id
,
uid
:
user
.
id
,
d
:
Cookies
.
get
(
'_idt'
)
,
i
:
Cookies
.
get
(
'_idt'
)
,
d
:
this
.
deviceId
,
i
:
this
.
deviceId
,
c
:
this
.
cid
,
// 课程ID
s
:
this
.
sid
,
// 学期ID
v
:
this
.
resourceId
,
// 视频资源ID
...
...
src/modules/viewer/index.vue
浏览文件 @
c717eaba
...
...
@@ -3,23 +3,10 @@
<div
class=
"course-viewer-main"
>
<!-- 顶部区域 -->
<div
class=
"course-viewer-main-hd"
>
<router-link
:to=
"`/
app/learn/course-detail/$
{sid}
/${cid}`">
<router-link
:to=
"`/
course/learn
/$
{cid}`">
<i
class=
"el-icon-arrow-left"
></i>
</router-link>
<h1
class=
"course-viewer-main-hd__title"
>
{{
detail
.
course_name
}}
</h1>
<!-- 直播的时候显示帮助按钮 -->
<template
v-if=
"isLive"
>
<router-link
to=
"/app/feedback/feedback-create"
target=
"_blank"
>
<el-tooltip
effect=
"light"
content=
"意见反馈"
>
<i
class=
"el-icon-self-fankuiyijian"
></i>
</el-tooltip>
</router-link>
<router-link
to=
"/mobile/help/student"
target=
"_blank"
>
<el-tooltip
effect=
"light"
content=
"帮助"
>
<i
class=
"el-icon-self-icon-test"
></i>
</el-tooltip>
</router-link>
</
template
>
<div
class=
"course-menu"
@
click=
"menuVisible = !menuVisible"
>
<i
class=
"el-icon-s-unfold"
v-if=
"menuVisible"
></i>
<i
class=
"el-icon-s-fold"
v-else
></i>
...
...
@@ -122,7 +109,7 @@ export default {
type
:
101
})
}
chapters
.
push
(
customeChapter
)
//
chapters.push(customeChapter)
return
chapters
},
// 当前选中的章节
...
...
src/modules/viewer/routes.js
浏览文件 @
c717eaba
export
default
[
{
path
:
'/viewer/:
sid/:
cid'
,
path
:
'/viewer/:cid'
,
component
:
()
=>
import
(
'./index.vue'
),
children
:
[
{
name
:
'viewerCourseChapter'
,
path
:
':id'
,
component
:
()
=>
import
(
'./components/layout.vue'
)
}
]
children
:
[{
name
:
'viewerCourseChapter'
,
path
:
':id'
,
component
:
()
=>
import
(
'./components/layout.vue'
)
}]
}
]
src/pages/account/password.vue
浏览文件 @
c717eaba
...
...
@@ -8,7 +8,7 @@
<el-input
type=
"password"
v-model=
"ruleForm.password"
placeholder=
"请输入新密码"
></el-input>
</el-form-item>
<el-form-item
label=
"重复新密码"
prop=
"passwordR"
>
<el-input
type=
"password"
v-model=
"ruleForm.passwordR"
placeholder=
"请重复
输入
新密码"
></el-input>
<el-input
type=
"password"
v-model=
"ruleForm.passwordR"
placeholder=
"请重复新密码"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
:loading=
"submitLoading"
@
click=
"handleSubmit"
>
保存
</el-button>
...
...
@@ -40,13 +40,13 @@ export default {
passwordR
:
''
},
rules
:
{
old_password
:
{
required
:
true
,
message
:
'请输入
登录
密码'
,
trigger
:
'blur'
},
old_password
:
{
required
:
true
,
message
:
'请输入密码'
,
trigger
:
'blur'
},
password
:
[
{
required
:
true
,
message
:
'请输入新
的登录
密码'
,
trigger
:
'blur'
},
{
required
:
true
,
message
:
'请输入新密码'
,
trigger
:
'blur'
},
{
min
:
6
,
max
:
20
,
message
:
'长度为6-20个字符'
,
trigger
:
'blur'
}
],
passwordR
:
[
{
required
:
true
,
message
:
'请
再次输入新的登录
密码'
,
trigger
:
'blur'
},
{
required
:
true
,
message
:
'请
重复新
密码'
,
trigger
:
'blur'
},
{
validator
:
validatePass
,
trigger
:
'blur'
}
]
},
...
...
src/pages/course/learn/item.vue
浏览文件 @
c717eaba
...
...
@@ -57,7 +57,9 @@ export default {
this
.
loaded
=
true
})
},
handleClick
(
data
)
{}
handleClick
(
data
)
{
this
.
$router
.
push
({
name
:
'viewerCourseChapter'
,
params
:
{
cid
:
this
.
courseId
,
id
:
data
.
id
}
})
}
},
beforeMount
()
{
this
.
getCourse
()
...
...
src/pages/course/tag/index.vue
浏览文件 @
c717eaba
<
template
>
<el-collapse
v-model=
"activeNames"
>
<el-collapse-item
:title=
"item.name"
:name=
"item.id"
v-for=
"item in detail.chapters"
:key=
"item.id"
>
<ul>
<li
v-for=
"subItem in item.tag"
:key=
"subItem.id"
@
click=
"handleClick(subItem)"
>
<div
class=
"name"
>
{{
subItem
.
title
}}
</div>
</li>
</ul>
</el-collapse-item>
</el-collapse>
<div
element-loading-text=
"加载中..."
v-loading=
"!loaded"
>
<el-collapse
v-model=
"activeNames"
v-if=
"detail.chapters.length"
>
<el-collapse-item
:title=
"item.name"
:name=
"item.id"
v-for=
"item in detail.chapters"
:key=
"item.id"
>
<ul>
<li
v-for=
"subItem in item.tag"
:key=
"subItem.id"
@
click=
"handleClick(subItem)"
>
<div
class=
"name"
>
{{
subItem
.
title
}}
</div>
</li>
</ul>
</el-collapse-item>
</el-collapse>
<div
class=
"empty"
v-else
>
暂无相关内容
</div>
</div>
</
template
>
<
script
>
...
...
@@ -24,6 +27,7 @@ export default {
},
data
()
{
return
{
loaded
:
false
,
detail
:
{
chapters
:
[]
},
activeNames
:
[]
}
...
...
@@ -31,9 +35,15 @@ export default {
methods
:
{
// 获取知识点列表
getCourseTagList
()
{
api
.
getCourseTagList
(
this
.
courseId
).
then
(
response
=>
{
this
.
detail
=
response
})
this
.
loaded
=
false
api
.
getCourseTagList
(
this
.
courseId
)
.
then
(
response
=>
{
this
.
detail
=
response
})
.
finally
(()
=>
{
this
.
loaded
=
true
})
},
handleClick
(
data
)
{
this
.
$router
.
push
({
name
:
'courseTagItem'
,
params
:
{
id
:
data
.
id
}
})
...
...
src/pages/course/tag/item.vue
浏览文件 @
c717eaba
...
...
@@ -65,7 +65,12 @@ export default {
this
.
$router
.
push
({
path
})
},
// 去课程视频页面
toCourseVideo
()
{}
toCourseVideo
()
{
this
.
$router
.
push
({
name
:
'viewerCourseChapter'
,
params
:
{
cid
:
this
.
detail
.
course_id
,
id
:
this
.
detail
.
section_id
}
})
}
},
beforeMount
()
{
this
.
getCourseTag
()
...
...
src/router/routes.js
浏览文件 @
c717eaba
import
Layout
from
'@/components/layout'
import
viewerRoutes
from
'@/modules/viewer/routes.js'
// 考证课程
const
courseRoutes
=
[
...
...
@@ -218,5 +219,6 @@ export default [
{
path
:
'course'
,
component
:
()
=>
import
(
/* webpackChunkName: "my" */
'@/pages/my/course'
)
},
{
path
:
'test'
,
component
:
()
=>
import
(
/* webpackChunkName: "my" */
'@/pages/my/test'
)
}
]
}
},
...
viewerRoutes
]
src/store/index.js
浏览文件 @
c717eaba
import
Vue
from
'vue'
import
Vuex
from
'vuex'
import
Cookies
from
'js-cookie'
import
{
getUser
,
logout
,
getIsVip
,
createGuestUser
}
from
'@/api/account'
Vue
.
use
(
Vuex
)
...
...
@@ -8,7 +7,6 @@ Vue.use(Vuex)
const
store
=
new
Vuex
.
Store
({
state
:
{
user
:
{},
token
:
''
,
isVip
:
false
,
isLogin
:
false
,
isIos
:
/iphone|ipad|ipod/i
.
test
(
navigator
.
userAgent
),
...
...
@@ -17,9 +15,6 @@ const store = new Vuex.Store({
guestUser
:
{
user_id
:
''
,
student_id
:
''
}
},
mutations
:
{
setToken
(
state
,
token
)
{
state
.
token
=
token
},
setUser
(
state
,
user
)
{
state
.
user
=
user
},
...
...
@@ -56,12 +51,10 @@ const store = new Vuex.Store({
const
isLogin
=
await
getUser
()
.
then
(
response
=>
{
commit
(
'setUser'
,
response
)
commit
(
'setToken'
,
Cookies
.
get
(
'TGC'
))
return
true
})
.
catch
(()
=>
{
commit
(
'setUser'
,
{})
commit
(
'setToken'
,
''
)
return
false
})
commit
(
'setIsLogin'
,
isLogin
)
...
...
src/style.scss
浏览文件 @
c717eaba
$--color-primary
:
#c01540
;
/* 改变 icon 字体路径变量,必需 */
$--font-path
:
'~element-ui/lib/theme-chalk/fonts'
;
@import
'~element-ui/packages/theme-chalk/src/index'
;
body
,
h1
,
h2
,
...
...
@@ -81,6 +87,10 @@ html {
-ms-text-size-adjust
:
100%
;
}
:root
{
--main-color
:
#c01540
;
}
body
{
font-size
:
14px
;
line-height
:
1
.4
;
...
...
src/utils/axios.js
浏览文件 @
c717eaba
...
...
@@ -7,7 +7,8 @@ const httpRequest = axios.create({
timeout
:
60000
,
withCredentials
:
true
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
'Content-Type'
:
'application/x-www-form-urlencoded'
,
tenant
:
'transport'
}
})
...
...
@@ -35,12 +36,15 @@ httpRequest.interceptors.response.use(
return
data
},
function
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
.
response
)
if
(
error
.
response
)
{
const
{
status
,
message
}
=
error
.
response
.
data
if
(
status
===
400
)
{
Message
.
error
(
message
)
// 未登录
if
(
status
===
403
)
{
// window.location.href = `${webConf.others.loginUrl}?rd=${encodeURIComponent(window.location.href)}`
}
Message
.
error
(
message
||
error
.
response
.
data
)
return
Promise
.
reject
(
error
.
response
)
}
else
{
Message
.
error
(
error
)
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论