提交 e61d3e9d 编写于 作者: fxy060608's avatar fxy060608

feat(app): androidPrivacy.json

上级 e34d4827
...@@ -13,7 +13,8 @@ var serviceContext = (function () { ...@@ -13,7 +13,8 @@ var serviceContext = (function () {
'base64ToArrayBuffer', 'base64ToArrayBuffer',
'arrayBufferToBase64', 'arrayBufferToBase64',
'addInterceptor', 'addInterceptor',
'removeInterceptor' 'removeInterceptor',
'interceptors'
]; ];
const network = [ const network = [
...@@ -253,7 +254,7 @@ var serviceContext = (function () { ...@@ -253,7 +254,7 @@ var serviceContext = (function () {
const ad = [ const ad = [
'createRewardedVideoAd', 'createRewardedVideoAd',
'createFullScreenVideoAd', 'createFullScreenVideoAd',
'createInterstitialAd', 'createInterstitialAd',
'createInteractiveAd' 'createInteractiveAd'
]; ];
...@@ -693,7 +694,7 @@ var serviceContext = (function () { ...@@ -693,7 +694,7 @@ var serviceContext = (function () {
} }
if (res === false) { if (res === false) {
return { return {
then () {} then () { }
} }
} }
} }
...@@ -741,15 +742,15 @@ var serviceContext = (function () { ...@@ -741,15 +742,15 @@ var serviceContext = (function () {
if (hook !== 'returnValue') { if (hook !== 'returnValue') {
interceptor[hook] = globalInterceptors[hook].slice(); interceptor[hook] = globalInterceptors[hook].slice();
} }
}); });
const scopedInterceptor = scopedInterceptors[method]; const scopedInterceptor = scopedInterceptors[method];
if (scopedInterceptor) { if (scopedInterceptor) {
Object.keys(scopedInterceptor).forEach(hook => { Object.keys(scopedInterceptor).forEach(hook => {
if (hook !== 'returnValue') { if (hook !== 'returnValue') {
interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]); interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
} }
}); });
} }
return interceptor return interceptor
} }
...@@ -773,10 +774,14 @@ var serviceContext = (function () { ...@@ -773,10 +774,14 @@ var serviceContext = (function () {
if (!isPromise(res)) { if (!isPromise(res)) {
return res return res
} }
return res.then(res => { return new Promise((resolve, reject) => {
return res[1] res.then(res => {
}).catch(res => { if (res[0]) {
return res[0] reject(res[0]);
} else {
resolve(res[1]);
}
});
}) })
} }
}; };
...@@ -1313,14 +1318,6 @@ var serviceContext = (function () { ...@@ -1313,14 +1318,6 @@ var serviceContext = (function () {
this.watchers.splice(index, 1); 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) { t(key, locale, values) {
let message = this.message; let message = this.message;
if (typeof locale === 'string') { if (typeof locale === 'string') {
...@@ -1403,9 +1400,6 @@ var serviceContext = (function () { ...@@ -1403,9 +1400,6 @@ var serviceContext = (function () {
t(key, values) { t(key, values) {
return t(key, values); return t(key, values);
}, },
getLocale() {
return i18n.getLocale();
},
setLocale(newLocale) { setLocale(newLocale) {
return i18n.setLocale(newLocale); return i18n.setLocale(newLocale);
}, },
...@@ -6806,11 +6800,11 @@ var serviceContext = (function () { ...@@ -6806,11 +6800,11 @@ var serviceContext = (function () {
const errorCallback = warpPlusErrorCallback(callbackId, 'chooseVideo', 'cancel'); const errorCallback = warpPlusErrorCallback(callbackId, 'chooseVideo', 'cancel');
function successCallback (tempFilePath = '') { 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) => { const compressVideo = compressed ? new Promise((resolve) => {
plus.zip.compressVideo({ plus.zip.compressVideo({
src: tempFilePath, src: tempFilePath,
dst filename
}, ({ tempFilePath }) => { }, ({ tempFilePath }) => {
resolve(tempFilePath); resolve(tempFilePath);
}, () => { }, () => {
...@@ -6908,11 +6902,11 @@ var serviceContext = (function () { ...@@ -6908,11 +6902,11 @@ var serviceContext = (function () {
} }
function compressVideo$1 (options, callbackId) { function compressVideo$1 (options, callbackId) {
const dst = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(options.src)}`; const filename = `${TEMP_PATH}/compressed/${Date.now()}_${getFileName(options.src)}`;
const successCallback = warpPlusSuccessCallback(callbackId, 'compressVideo'); const successCallback = warpPlusSuccessCallback(callbackId, 'compressVideo');
const errorCallback = warpPlusErrorCallback(callbackId, 'compressVideo'); const errorCallback = warpPlusErrorCallback(callbackId, 'compressVideo');
plus.zip.compressVideo(Object.assign({}, options, { plus.zip.compressVideo(Object.assign({}, options, {
dst filename
}), successCallback, errorCallback); }), successCallback, errorCallback);
} }
...@@ -7536,7 +7530,7 @@ var serviceContext = (function () { ...@@ -7536,7 +7530,7 @@ var serviceContext = (function () {
} }
if (files && files.length) { if (files && files.length) {
files.forEach(file => { files.forEach(file => {
uploader.addFile(getRealPath$1(file.uri), { uploader.addFile(getRealPath$1(file.uri || file.filePath), {
key: file.name || 'file' key: file.name || 'file'
}); });
}); });
...@@ -20967,6 +20961,9 @@ var serviceContext = (function () { ...@@ -20967,6 +20961,9 @@ var serviceContext = (function () {
} }
const evalJSCode = const evalJSCode =
`typeof UniViewJSBridge !== 'undefined' && UniViewJSBridge.subscribeHandler("${eventType}",${args},__PAGE_ID__)`; `typeof UniViewJSBridge !== 'undefined' && UniViewJSBridge.subscribeHandler("${eventType}",${args},__PAGE_ID__)`;
if (process.env.NODE_ENV !== 'production') {
console.log(`UNIAPP[publishHandler]:[${+new Date()}]`, 'length', evalJSCode.length);
}
pageIds.forEach(id => { pageIds.forEach(id => {
const webview = plus.webview.getWebviewById(String(id)); const webview = plus.webview.getWebviewById(String(id));
webview && webview.evalJS(evalJSCode.replace('__PAGE_ID__', id)); webview && webview.evalJS(evalJSCode.replace('__PAGE_ID__', id));
......
...@@ -27,7 +27,7 @@ module.exports = { ...@@ -27,7 +27,7 @@ module.exports = {
subPackages: true subPackages: true
}, },
copyWebpackOptions (platformOptions, vueOptions) { copyWebpackOptions (platformOptions, vueOptions) {
const copyOptions = [] const copyOptions = ['androidPrivacy.json']
const componentsCopyOption = getComponentsCopyOption() const componentsCopyOption = getComponentsCopyOption()
if (componentsCopyOption) { if (componentsCopyOption) {
copyOptions.push(componentsCopyOption) copyOptions.push(componentsCopyOption)
......
...@@ -29,7 +29,7 @@ module.exports = { ...@@ -29,7 +29,7 @@ module.exports = {
'ext.json', 'ext.json',
'custom-tab-bar', 'custom-tab-bar',
'plugin.json', 'plugin.json',
'functional-pages', 'functional-pages'
] ]
const workers = platformOptions.workers const workers = platformOptions.workers
workers && copyOptions.push(workers) workers && copyOptions.push(workers)
......
...@@ -208,7 +208,16 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) { ...@@ -208,7 +208,16 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
const array = [{ const array = [{
from: path.resolve(process.env.UNI_INPUT_DIR, 'static'), from: path.resolve(process.env.UNI_INPUT_DIR, 'static'),
to: 'static' to: 'static'
}] }]
const androidPrivacyPath = path.resolve(process.env.UNI_INPUT_DIR, 'androidPrivacy.json')
if (fs.existsSync(androidPrivacyPath)) {
array.push({
from: androidPrivacyPath,
to: 'androidPrivacy.json'
})
}
const hybridHtmlPath = path.resolve(process.env.UNI_INPUT_DIR, 'hybrid/html') const hybridHtmlPath = path.resolve(process.env.UNI_INPUT_DIR, 'hybrid/html')
if (fs.existsSync(hybridHtmlPath)) { if (fs.existsSync(hybridHtmlPath)) {
array.push({ array.push({
...@@ -216,6 +225,7 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) { ...@@ -216,6 +225,7 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
to: 'hybrid/html' to: 'hybrid/html'
}) })
} }
if (process.env.UNI_USING_NVUE_COMPILER) { if (process.env.UNI_USING_NVUE_COMPILER) {
array.push({ array.push({
from: path.resolve(getTemplatePath(), 'common'), from: path.resolve(getTemplatePath(), 'common'),
......
...@@ -172,7 +172,7 @@ module.exports = { ...@@ -172,7 +172,7 @@ module.exports = {
if (process.env.UNI_MP_PLUGIN) { if (process.env.UNI_MP_PLUGIN) {
// 小程序插件入口使用 // 小程序插件入口使用
// packages\webpack-uni-mp-loader\lib\plugin\index-new.js -> addMPPluginRequire // packages\webpack-uni-mp-loader\lib\plugin\index-new.js -> addMPPluginRequire
beforeCode += `wx.__webpack_require_${process.env.UNI_MP_PLUGIN.replace(/-/g,'_')}__ = __webpack_require__;` beforeCode += `wx.__webpack_require_${process.env.UNI_MP_PLUGIN.replace(/-/g, '_')}__ = __webpack_require__;`
const UNI_MP_PLUGIN_MAIN = process.env.UNI_MP_PLUGIN_MAIN const UNI_MP_PLUGIN_MAIN = process.env.UNI_MP_PLUGIN_MAIN
if (UNI_MP_PLUGIN_MAIN) { if (UNI_MP_PLUGIN_MAIN) {
......
...@@ -80,7 +80,7 @@ function addMPPluginRequire (compilation) { ...@@ -80,7 +80,7 @@ function addMPPluginRequire (compilation) {
const newlineIndex = compilation.assets[name].source().lastIndexOf('\n') const newlineIndex = compilation.assets[name].source().lastIndexOf('\n')
const source = compilation.assets[name].source().substring(0, newlineIndex) + const source = compilation.assets[name].source().substring(0, newlineIndex) +
`\nmodule.exports = wx.__webpack_require_${process.env.UNI_MP_PLUGIN.replace(/-/g,'_')}__('${uniModuleId}');\n` + `\nmodule.exports = wx.__webpack_require_${process.env.UNI_MP_PLUGIN.replace(/-/g, '_')}__('${uniModuleId}');\n` +
compilation.assets[name].source().substring(newlineIndex + 1) compilation.assets[name].source().substring(newlineIndex + 1)
compilation.assets[name] = { compilation.assets[name] = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册