提交 18271ac9 编写于 作者: Q qiang

chore: build app

上级 9c77d5a2
......@@ -13,7 +13,8 @@ var serviceContext = (function () {
'base64ToArrayBuffer',
'arrayBufferToBase64',
'addInterceptor',
'removeInterceptor'
'removeInterceptor',
'interceptors'
];
const network = [
......@@ -253,7 +254,7 @@ var serviceContext = (function () {
const ad = [
'createRewardedVideoAd',
'createFullScreenVideoAd',
'createInterstitialAd',
'createInterstitialAd',
'createInteractiveAd'
];
......@@ -693,7 +694,7 @@ var serviceContext = (function () {
}
if (res === false) {
return {
then () {}
then () { }
}
}
}
......@@ -741,15 +742,15 @@ var serviceContext = (function () {
if (hook !== 'returnValue') {
interceptor[hook] = globalInterceptors[hook].slice();
}
});
const scopedInterceptor = scopedInterceptors[method];
if (scopedInterceptor) {
Object.keys(scopedInterceptor).forEach(hook => {
if (hook !== 'returnValue') {
interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
}
});
}
});
const scopedInterceptor = scopedInterceptors[method];
if (scopedInterceptor) {
Object.keys(scopedInterceptor).forEach(hook => {
if (hook !== 'returnValue') {
interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
}
});
}
return interceptor
}
......@@ -773,10 +774,14 @@ var serviceContext = (function () {
if (!isPromise(res)) {
return res
}
return res.then(res => {
return res[1]
}).catch(res => {
return res[0]
return new Promise((resolve, reject) => {
res.then(res => {
if (res[0]) {
reject(res[0]);
} else {
resolve(res[1]);
}
});
})
}
};
......@@ -1313,14 +1318,6 @@ var serviceContext = (function () {
this.watchers.splice(index, 1);
};
}
mergeLocaleMessage(locale, message) {
if (this.messages[locale]) {
Object.assign(this.messages[locale], message);
}
else {
this.messages[locale] = message;
}
}
t(key, locale, values) {
let message = this.message;
if (typeof locale === 'string') {
......@@ -6806,11 +6803,11 @@ var serviceContext = (function () {
const errorCallback = warpPlusErrorCallback(callbackId, 'chooseVideo', 'cancel');
function successCallback (tempFilePath = '') {
const dst = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(tempFilePath)}`;
const filename = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(tempFilePath)}`;
const compressVideo = compressed ? new Promise((resolve) => {
plus.zip.compressVideo({
src: tempFilePath,
dst
filename
}, ({ tempFilePath }) => {
resolve(tempFilePath);
}, () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册