Skip to content

Commit 7e8e1d0

Browse files
author
Taois
committed
feat: 修复调用传参,优化图片无限请求问题。筛选图标放在分类上面
1 parent 0f6acd5 commit 7e8e1d0

File tree

10 files changed

+400
-138
lines changed

10 files changed

+400
-138
lines changed

dashboard/src/api/services/video.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,10 @@ class VideoService {
143143
* @param {string} videoId - 视频ID
144144
* @param {string} apiUrl - 站点API地址
145145
* @param {boolean} skipCache - 是否跳过缓存
146+
* @param {string} extend - 扩展参数
146147
* @returns {Promise} 视频详情数据
147148
*/
148-
async getVideoDetails(module, videoId, apiUrl, skipCache = false) {
149+
async getVideoDetails(module, videoId, apiUrl, skipCache = false, extend = null) {
149150
if (!validateModule(module)) {
150151
throw new Error('无效的模块名称')
151152
}
@@ -172,6 +173,9 @@ class VideoService {
172173
if (apiUrl) {
173174
params.apiUrl = apiUrl
174175
}
176+
if (extend) {
177+
params.extend = extend
178+
}
175179
const response = await getVideoDetail(module, params)
176180

177181
if (!response.list || response.list.length === 0) {
@@ -251,11 +255,12 @@ class VideoService {
251255
/**
252256
* 获取播放地址
253257
* @param {string} module - 模块名称
254-
* @param {string} playUrl - 播放地址或ID
255-
* @param {string} apiUrl - 站点API地址
258+
* @param {string} playUrl - 播放地址
259+
* @param {string} apiUrl - API地址
260+
* @param {string} extend - 扩展参数
256261
* @returns {Promise} 播放数据
257262
*/
258-
async getPlayUrl(module, playUrl, apiUrl) {
263+
async getPlayUrl(module, playUrl, apiUrl, extend = null) {
259264
if (!validateModule(module)) {
260265
throw new Error('无效的模块名称')
261266
}
@@ -269,6 +274,9 @@ class VideoService {
269274
if (apiUrl) {
270275
params.apiUrl = apiUrl
271276
}
277+
if (extend) {
278+
params.extend = extend
279+
}
272280
const response = await getPlayData(module, params)
273281

274282
return {
@@ -317,9 +325,11 @@ class VideoService {
317325
/**
318326
* 刷新模块数据
319327
* @param {string} module - 模块名称
328+
* @param {string} extend - 扩展参数
329+
* @param {string} apiUrl - API地址
320330
* @returns {Promise} 刷新结果
321331
*/
322-
async refreshModuleData(module) {
332+
async refreshModuleData(module, extend = null, apiUrl = null) {
323333
if (!validateModule(module)) {
324334
throw new Error('无效的模块名称')
325335
}
@@ -328,7 +338,7 @@ class VideoService {
328338
// 清除相关缓存
329339
this.clearModuleCache(module)
330340

331-
const response = await refreshModule(module)
341+
const response = await refreshModule(module, extend, apiUrl)
332342

333343
return {
334344
success: true,

0 commit comments

Comments
 (0)