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

feat(app): androidPrivacy.json

上级 e34d4827
......@@ -13,7 +13,8 @@ var serviceContext = (function () {
'base64ToArrayBuffer',
'arrayBufferToBase64',
'addInterceptor',
'removeInterceptor'
'removeInterceptor',
'interceptors'
];
const network = [
......@@ -693,7 +694,7 @@ var serviceContext = (function () {
}
if (res === false) {
return {
then () {}
then () { }
}
}
}
......@@ -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') {
......@@ -1403,9 +1400,6 @@ var serviceContext = (function () {
t(key, values) {
return t(key, values);
},
getLocale() {
return i18n.getLocale();
},
setLocale(newLocale) {
return i18n.setLocale(newLocale);
},
......@@ -6806,11 +6800,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);
}, () => {
......@@ -6908,11 +6902,11 @@ var serviceContext = (function () {
}
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 errorCallback = warpPlusErrorCallback(callbackId, 'compressVideo');
plus.zip.compressVideo(Object.assign({}, options, {
dst
filename
}), successCallback, errorCallback);
}
......@@ -7536,7 +7530,7 @@ var serviceContext = (function () {
}
if (files && files.length) {
files.forEach(file => {
uploader.addFile(getRealPath$1(file.uri), {
uploader.addFile(getRealPath$1(file.uri || file.filePath), {
key: file.name || 'file'
});
});
......@@ -20967,6 +20961,9 @@ var serviceContext = (function () {
}
const evalJSCode =
`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 => {
const webview = plus.webview.getWebviewById(String(id));
webview && webview.evalJS(evalJSCode.replace('__PAGE_ID__', id));
......
......@@ -27,7 +27,7 @@ module.exports = {
subPackages: true
},
copyWebpackOptions (platformOptions, vueOptions) {
const copyOptions = []
const copyOptions = ['androidPrivacy.json']
const componentsCopyOption = getComponentsCopyOption()
if (componentsCopyOption) {
copyOptions.push(componentsCopyOption)
......
......@@ -29,7 +29,7 @@ module.exports = {
'ext.json',
'custom-tab-bar',
'plugin.json',
'functional-pages',
'functional-pages'
]
const workers = platformOptions.workers
workers && copyOptions.push(workers)
......
......@@ -209,6 +209,15 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
from: path.resolve(process.env.UNI_INPUT_DIR, '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')
if (fs.existsSync(hybridHtmlPath)) {
array.push({
......@@ -216,6 +225,7 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
to: 'hybrid/html'
})
}
if (process.env.UNI_USING_NVUE_COMPILER) {
array.push({
from: path.resolve(getTemplatePath(), 'common'),
......
......@@ -172,7 +172,7 @@ module.exports = {
if (process.env.UNI_MP_PLUGIN) {
// 小程序插件入口使用
// 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
if (UNI_MP_PLUGIN_MAIN) {
......
......@@ -80,7 +80,7 @@ function addMPPluginRequire (compilation) {
const newlineIndex = compilation.assets[name].source().lastIndexOf('\n')
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] = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册