Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-learn
Commits
a7223678
提交
a7223678
authored
8月 01, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: update
上级
d34299ec
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
27 行增加
和
46 行删除
+27
-46
base.ts
src/api/base.ts
+1
-1
useCollectionResource.ts
src/composables/useCollectionResource.ts
+0
-14
api.ts
src/modules/course/api.ts
+19
-19
api.ts
src/modules/favorites/api.ts
+3
-3
api.ts
src/modules/settings/api.ts
+2
-2
axios.ts
src/utils/axios.ts
+1
-1
vite.config.ts
vite.config.ts
+1
-6
没有找到文件。
src/api/base.ts
浏览文件 @
a7223678
...
...
@@ -73,5 +73,5 @@ export function collectionResource(data: {
type
:
number
status
:
number
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/collection/resource'
,
data
)
return
httpRequest
.
post
(
'/api/
learn
/api/v1/collection/resource'
,
data
)
}
src/composables/useCollectionResource.ts
deleted
100644 → 0
浏览文件 @
d34299ec
import
{
collectionResource
}
from
'@/api/base'
export
async
function
useCollectionResource
(
params
:
{
course_id
:
string
semester_id
:
string
chapter_id
:
string
section_id
:
string
source_id
:
string
type
:
number
status
:
number
})
{
const
res
=
await
collectionResource
(
params
)
console
.
log
(
res
)
}
src/modules/course/api.ts
浏览文件 @
a7223678
...
...
@@ -2,34 +2,34 @@ import httpRequest from '@/utils/axios'
// 获取课程列表
export
function
getCourseList
(
params
?:
{
id
?:
string
;
semester_ids
?:
string
;
elective_types
?:
string
})
{
return
httpRequest
.
get
(
'/api/
saas
/api/v1/course/list'
,
{
params
})
return
httpRequest
.
get
(
'/api/
learn
/api/v1/course/list'
,
{
params
})
}
// 搜索课程
export
function
searchCourseList
(
params
?:
{
search_name
?:
string
;
semester_ids
?:
string
;
elective_types
?:
string
})
{
return
httpRequest
.
get
(
'/api/
saas
/api/v1/course/search'
,
{
params
})
return
httpRequest
.
get
(
'/api/
learn
/api/v1/course/search'
,
{
params
})
}
// 获取学期
export
function
getSemesterList
()
{
return
httpRequest
.
get
(
'/api/
saas
/api/v1/semester/student-semesters'
)
return
httpRequest
.
get
(
'/api/
learn
/api/v1/semester/student-semesters'
)
}
// 置顶课程
export
function
topCourse
(
data
:
{
id
:
string
;
status
:
number
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/course/sticky-top'
,
data
)
return
httpRequest
.
post
(
'/api/
learn
/api/v1/course/sticky-top'
,
data
)
}
// 获取课程详情信息
export
function
getCourse
(
params
:
{
course_id
:
string
;
semester_id
:
string
})
{
return
httpRequest
.
get
(
`/api/
saas
/api/v1/course/
${
params
.
course_id
}
/detail/
${
params
.
semester_id
}
`
,
{
params
})
return
httpRequest
.
get
(
`/api/
learn
/api/v1/course/
${
params
.
course_id
}
/detail/
${
params
.
semester_id
}
`
,
{
params
})
}
// 获取章节列表
export
function
getChapterTreeList
(
data
:
{
course_id
:
string
;
semester_id
:
string
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/chapter/tree'
,
data
)
return
httpRequest
.
post
(
'/api/
learn
/api/v1/chapter/tree'
,
data
)
}
// 课程考核列表
export
function
getChapterVideoTreeList
(
data
:
{
course_id
:
string
;
semester_id
:
string
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/chapter/video-tree'
,
data
)
return
httpRequest
.
post
(
'/api/
learn
/api/v1/chapter/video-tree'
,
data
)
}
// 收藏/取消收藏
...
...
@@ -42,12 +42,12 @@ export function collectionResource(data: {
type
:
number
status
:
number
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/collection/resource'
,
data
)
return
httpRequest
.
post
(
'/api/
learn
/api/v1/collection/resource'
,
data
)
}
// 获取课程大作业详情
export
function
getCourseWork
(
data
:
{
course_id
:
string
;
semester_id
:
string
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/job/detail'
,
data
)
return
httpRequest
.
post
(
'/api/
learn
/api/v1/job/detail'
,
data
)
}
// 提交大作业
export
function
submitCourseWork
(
data
:
{
...
...
@@ -57,27 +57,27 @@ export function submitCourseWork(data: {
content
:
string
attachments
?:
string
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/job/submit'
,
data
)
return
httpRequest
.
post
(
'/api/
learn
/api/v1/job/submit'
,
data
)
}
// 获取课程直播列表
export
function
getCourseExamList
(
params
:
{
course_id
:
string
;
semester_id
:
string
})
{
return
httpRequest
.
get
(
'/api/
saas
/api/v1/question-bank/papers'
,
{
params
})
return
httpRequest
.
get
(
'/api/
learn
/api/v1/question-bank/papers'
,
{
params
})
}
// 获取课程直播列表
export
function
getCourseLiveList
(
data
:
{
course_id
:
string
;
semester_id
:
string
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/meeting/list'
,
data
)
return
httpRequest
.
post
(
'/api/
learn
/api/v1/meeting/list'
,
data
)
}
// 获取课程小节信息
export
function
getCourseSection
(
data
:
{
section_id
:
string
;
semester_id
:
string
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/chapter/section/detail'
,
data
)
return
httpRequest
.
post
(
'/api/
learn
/api/v1/chapter/section/detail'
,
data
)
}
// 获取课程视频信息
export
function
getCoursePlayInfo
(
params
:
{
source_id
:
string
})
{
return
httpRequest
.
get
(
`/api/
saas
/api/v1/video/vod/
${
params
.
source_id
}
/playing-info`
,
{
params
})
return
httpRequest
.
get
(
`/api/
learn
/api/v1/video/vod/
${
params
.
source_id
}
/playing-info`
,
{
params
})
}
// 获取视频观看记录
export
function
getVideoRecords
(
data
:
{
...
...
@@ -87,7 +87,7 @@ export function getVideoRecords(data: {
semester_id
:
string
video_id
:
string
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/course/video/recent-viewings'
,
data
)
return
httpRequest
.
post
(
'/api/
learn
/api/v1/course/video/recent-viewings'
,
data
)
}
// 上传视频观看记录
export
function
uploadVideoRecords
(
data
:
{
...
...
@@ -101,7 +101,7 @@ export function uploadVideoRecords(data: {
valid_playing_time
:
number
video_id
:
string
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/course/video/upload-records'
,
data
)
return
httpRequest
.
post
(
'/api/
learn
/api/v1/course/video/upload-records'
,
data
)
}
/**
...
...
@@ -111,7 +111,7 @@ export function uploadVideoRecords(data: {
// 获取试卷详情
export
function
getPaper
(
data
:
{
course_id
:
string
;
semester_id
:
string
;
paper_id
:
string
;
type
:
number
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/question-bank/paper-question/detail'
,
data
)
return
httpRequest
.
post
(
'/api/
learn
/api/v1/question-bank/paper-question/detail'
,
data
)
}
// 缓存试卷
export
function
cachePaper
(
data
:
{
...
...
@@ -121,7 +121,7 @@ export function cachePaper(data: {
type
:
number
question
:
any
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/question-bank/paper-question/cache'
,
data
)
return
httpRequest
.
post
(
'/api/
learn
/api/v1/question-bank/paper-question/cache'
,
data
)
}
// 提交试卷
export
function
submitPaper
(
data
:
{
...
...
@@ -131,7 +131,7 @@ export function submitPaper(data: {
type
:
number
question
:
any
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/question-bank/paper/hand'
,
data
,
{
return
httpRequest
.
post
(
'/api/
learn
/api/v1/question-bank/paper/hand'
,
data
,
{
headers
:
{
'Content-Type'
:
'application/json'
}
})
}
...
...
src/modules/favorites/api.ts
浏览文件 @
a7223678
...
...
@@ -2,7 +2,7 @@ import httpRequest from '@/utils/axios'
// 获取收藏列表
export
function
getCollectionList
(
params
?:
{
type
?:
string
;
course_id
?:
string
;
semester_id
?:
string
})
{
return
httpRequest
.
get
(
'/api/
saas
/api/v1/collection/list'
,
{
params
})
return
httpRequest
.
get
(
'/api/
learn
/api/v1/collection/list'
,
{
params
})
}
// 收藏/取消收藏
...
...
@@ -15,10 +15,10 @@ export function collectionResource(data: {
type
:
number
status
:
number
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/collection/resource'
,
data
)
return
httpRequest
.
post
(
'/api/
learn
/api/v1/collection/resource'
,
data
)
}
// 获取所有课程
export
function
getCourseList
()
{
return
httpRequest
.
get
(
'/api/
saas
/api/v1/course/all'
)
return
httpRequest
.
get
(
'/api/
learn
/api/v1/course/all'
)
}
src/modules/settings/api.ts
浏览文件 @
a7223678
...
...
@@ -10,9 +10,9 @@ export function updatePassword(data: { old_password: string; password: string; p
// 获取投诉建议列表
export
function
getSuggestionList
(
params
?:
{
page
?:
number
;
limit
?:
number
;
status
?:
string
})
{
return
httpRequest
.
get
(
'/api/
saas
/api/v1/suggestion/list'
,
{
params
})
return
httpRequest
.
get
(
'/api/
learn
/api/v1/suggestion/list'
,
{
params
})
}
// 提交投诉建议
export
function
submitSuggestion
(
data
:
{
title
:
string
;
content
:
string
;
files
?:
string
})
{
return
httpRequest
.
post
(
'/api/
saas
/api/v1/suggestion/complaint'
,
data
)
return
httpRequest
.
post
(
'/api/
learn
/api/v1/suggestion/complaint'
,
data
)
}
src/utils/axios.ts
浏览文件 @
a7223678
...
...
@@ -15,7 +15,7 @@ httpRequest.interceptors.request.use(
function
(
config
)
{
// 权限接口单独签名
// https://gitlab.ezijing.com/root/api-documents/-/blob/master/ezijing_permissions/%E7%AD%BE%E5%90%8D%E9%AA%8C%E8%AF%81.md
if
(
config
.
url
&&
/^
\/
api
\/
saas
/
.
test
(
config
.
url
))
{
if
(
config
.
url
&&
/^
\/
api
\/
learn
/
.
test
(
config
.
url
))
{
// 默认参数
const
defaultHeaders
=
{
timestamp
:
Date
.
now
(),
...
...
vite.config.ts
浏览文件 @
a7223678
...
...
@@ -30,12 +30,7 @@ export default defineConfig(({ mode }) => ({
cert
:
fs
.
readFileSync
(
path
.
join
(
__dirname
,
'./https/dev.ezijing.com.pem'
))
},
proxy
:
{
'/api/saas'
:
{
target
:
'http://api.ezijing.com:9501'
,
changeOrigin
:
true
,
rewrite
:
path
=>
path
.
replace
(
/^
\/
api
\/
saas/
,
''
)
},
'/api'
:
'https://resource-center.ezijing.com'
'/api'
:
'https://saas-learn.ezijing.com'
}
}
}))
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论