@aochuang/common 1.0.141 → 1.0.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/voice-player/voice-player.vue +0 -12
- package/package.json +1 -1
- package/utils/util.js +14 -6
|
@@ -402,21 +402,9 @@ export default {
|
|
|
402
402
|
if (!Number.isFinite(targetValue)) {
|
|
403
403
|
return
|
|
404
404
|
}
|
|
405
|
-
const rawTargetValue = targetValue
|
|
406
405
|
if (this.voiceSeconds) {
|
|
407
406
|
targetValue = Math.max(0, Math.min(targetValue, Number(this.voiceSeconds)))
|
|
408
407
|
}
|
|
409
|
-
console.log('[vtt-sync] ac voice setPlayPosition', {
|
|
410
|
-
position,
|
|
411
|
-
rawTargetValue,
|
|
412
|
-
targetValue,
|
|
413
|
-
voiceSeconds: this.voiceSeconds,
|
|
414
|
-
controlPlayPosition: this.controlPlayPosition,
|
|
415
|
-
isPlaying: this.isPlaying,
|
|
416
|
-
isPause: this.isPause,
|
|
417
|
-
playUrl: this.AcVoice && this.AcVoice.playUrl,
|
|
418
|
-
innerUrl: this.innerUrl
|
|
419
|
-
})
|
|
420
408
|
clearTimeout(this._controlChangeTimer)
|
|
421
409
|
this.controlPlayPosition = targetValue
|
|
422
410
|
if (this.AcVoice.playUrl !== this.innerUrl) {
|
package/package.json
CHANGED
package/utils/util.js
CHANGED
|
@@ -221,6 +221,9 @@ export function createThrottleRequest (requestFn, idField = 'id') {
|
|
|
221
221
|
let loadMap = {}
|
|
222
222
|
let timer = null
|
|
223
223
|
return (id) => {
|
|
224
|
+
if (cacheMap[id]) {
|
|
225
|
+
return cacheMap[id]
|
|
226
|
+
}
|
|
224
227
|
const ps = createPromise()
|
|
225
228
|
cacheMap[id] = ps
|
|
226
229
|
loadMap[id] = true
|
|
@@ -231,12 +234,15 @@ export function createThrottleRequest (requestFn, idField = 'id') {
|
|
|
231
234
|
requestFn(keys).then(rs => {
|
|
232
235
|
if (rs && rs.length) {
|
|
233
236
|
rs.forEach(v => {
|
|
234
|
-
|
|
235
|
-
cacheMap[
|
|
237
|
+
const cacheId = v[idField]
|
|
238
|
+
if (cacheMap[cacheId]) {
|
|
239
|
+
cacheMap[cacheId]._execed = true
|
|
240
|
+
cacheMap[cacheId].resolve(v)
|
|
241
|
+
}
|
|
236
242
|
})
|
|
237
243
|
}
|
|
238
244
|
keys.forEach(id => {
|
|
239
|
-
if (!cacheMap[id]._execed) {
|
|
245
|
+
if (cacheMap[id] && !cacheMap[id]._execed) {
|
|
240
246
|
// 如果没有返回表示没有找到数据
|
|
241
247
|
cacheMap[id].reject(new Error('未找到数据'))
|
|
242
248
|
}
|
|
@@ -244,8 +250,10 @@ export function createThrottleRequest (requestFn, idField = 'id') {
|
|
|
244
250
|
return rs
|
|
245
251
|
}, err => {
|
|
246
252
|
keys.forEach(id => {
|
|
247
|
-
cacheMap[id]
|
|
248
|
-
|
|
253
|
+
if (cacheMap[id]) {
|
|
254
|
+
cacheMap[id]._execed = true
|
|
255
|
+
cacheMap[id].reject(err)
|
|
256
|
+
}
|
|
249
257
|
})
|
|
250
258
|
}).finally(() => {
|
|
251
259
|
cacheMap = {}
|
|
@@ -424,4 +432,4 @@ export const retryRequest = (() => {
|
|
|
424
432
|
}
|
|
425
433
|
}
|
|
426
434
|
}
|
|
427
|
-
})()
|
|
435
|
+
})()
|