提交 6a24d2d9 编写于 作者: Q qiang

fix(App): compressVideo filename

上级 d8a1cf62
...@@ -5903,12 +5903,12 @@ var serviceContext = (function (vue) { ...@@ -5903,12 +5903,12 @@ var serviceContext = (function (vue) {
}, CompressImageProtocol, CompressImageOptions); }, CompressImageProtocol, CompressImageOptions);
const compressVideo = defineAsyncApi(API_COMPRESS_VIDEO, (options, { resolve, reject }) => { const compressVideo = defineAsyncApi(API_COMPRESS_VIDEO, (options, { resolve, reject }) => {
const dst = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(options.src)}`; const filename = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(options.src)}`;
plus.zip.compressVideo(extend({}, options, { plus.zip.compressVideo(extend({}, options, {
dst, filename,
}), () => { }), () => {
resolve({ resolve({
tempFilePath: dst, tempFilePath: filename,
}); });
}, reject); }, reject);
}, CompressVideoProtocol, CompressVideoOptions); }, CompressVideoProtocol, CompressVideoOptions);
......
...@@ -12,16 +12,16 @@ import { ...@@ -12,16 +12,16 @@ import {
export const compressVideo = defineAsyncApi<API_TYPE_COMPRESS_VIDEO>( export const compressVideo = defineAsyncApi<API_TYPE_COMPRESS_VIDEO>(
API_COMPRESS_VIDEO, API_COMPRESS_VIDEO,
(options, { resolve, reject }) => { (options, { resolve, reject }) => {
const dst = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName( const filename = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(
options.src options.src
)}` )}`
plus.zip.compressVideo( plus.zip.compressVideo(
extend({}, options, { extend({}, options, {
dst, filename,
}), }),
() => { () => {
resolve({ resolve({
tempFilePath: dst, tempFilePath: filename,
}) })
}, },
reject reject
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册