|
|
@@ -15,7 +15,7 @@
|
|
|
<div class="course-items-container">
|
|
|
<el-card v-for="item in getCoursesSlice(0, 5)" :key="item.courseId" class="course-item active" @click="handleClick(item.courseId)">
|
|
|
<div style="width: 200px; height: 120px">
|
|
|
- <img :src="item.courseImages[0]" :alt="item.courseName" class="course-item-img">
|
|
|
+ <img :src="convertImageUrl(item.courseImages[0], item.courseName)" :alt="item.courseName" class="course-item-img">
|
|
|
</div>
|
|
|
<div class="course-item-content">
|
|
|
<div style="font-weight: bold; font-size: 16px; margin: 5px 0">{{item.courseName}}</div>
|
|
|
@@ -33,7 +33,7 @@
|
|
|
<div class="course-items-container">
|
|
|
<el-card v-for="item in getCoursesSlice(5, 10)" :key="item.courseId" class="course-item active" @click="handleClick(item.courseId)">
|
|
|
<div style="width: 200px; height: 120px">
|
|
|
- <img :src="item.courseImages[0]" :alt="item.courseName" class="course-item-img">
|
|
|
+ <img :src="convertImageUrl(item.courseImages[0], item.courseName)" :alt="item.courseName" class="course-item-img">
|
|
|
</div>
|
|
|
<div class="course-item-content">
|
|
|
<div style="font-weight: bold; font-size: 16px; margin: 5px 0">{{item.courseName}}</div>
|
|
|
@@ -70,6 +70,7 @@ import type {CourseQuery} from "@/types/query";
|
|
|
import router from "@/router";
|
|
|
import {useStore} from "@/store";
|
|
|
import {Refresh, Search} from "@element-plus/icons-vue";
|
|
|
+import {convertImageUrl} from "@/utils/convertUtil";
|
|
|
|
|
|
const apis = useApis()
|
|
|
const store = useStore()
|
|
|
@@ -171,19 +172,12 @@ const fetchData = () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const processData = () => {
|
|
|
- for(let i:number = 0; i < pageInfo.courseData.length; i++){
|
|
|
- console.log(pageInfo.courseData[i].courseImages[0])
|
|
|
- pageInfo.courseData[i].courseImages[0] = pageInfo.courseData[i].courseImages[0].split("?")[0]
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
const fetchAllCourse = () => {
|
|
|
apis.getAllCourse(query, queryInfo.pageNow, queryInfo.pageSize)
|
|
|
.then((res: any) => {
|
|
|
console.log(res)
|
|
|
pageInfo.courseData = res.data.data.records
|
|
|
- processData()
|
|
|
pageInfo.total = res.data.data.total
|
|
|
Object.assign(pageInfo2Show, pageInfo)
|
|
|
})
|
|
|
@@ -199,7 +193,6 @@ const fetchCourseByUserId = () => {
|
|
|
.then((res: any) => {
|
|
|
console.log(res)
|
|
|
pageInfo.courseData = res.data.data.records
|
|
|
- processData()
|
|
|
pageInfo.total = res.data.data.total
|
|
|
Object.assign(pageInfo2Show, pageInfo)
|
|
|
})
|
|
|
@@ -212,7 +205,6 @@ const fetchCourseByUserId = () => {
|
|
|
.then((res: any) => {
|
|
|
console.log(res.data.data)
|
|
|
pageInfo.courseData = res.data.data.records
|
|
|
- processData()
|
|
|
pageInfo.total = res.data.data.total
|
|
|
Object.assign(pageInfo2Show, pageInfo)
|
|
|
})
|