Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
e61d3e9d
U
uni-app
项目概览
DCloud
/
uni-app
4 个月 前同步成功
通知
726
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e61d3e9d
编写于
8月 06, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(app): androidPrivacy.json
上级
e34d4827
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
44 addition
and
37 deletion
+44
-37
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+29
-32
packages/uni-app-plus/lib/uni.config.js
packages/uni-app-plus/lib/uni.config.js
+1
-1
packages/uni-mp-weixin/lib/uni.config.js
packages/uni-mp-weixin/lib/uni.config.js
+1
-1
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
+11
-1
packages/vue-cli-plugin-uni/lib/mp/index.js
packages/vue-cli-plugin-uni/lib/mp/index.js
+1
-1
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
+1
-1
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
e61d3e9d
...
@@ -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));
...
...
packages/uni-app-plus/lib/uni.config.js
浏览文件 @
e61d3e9d
...
@@ -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
)
...
...
packages/uni-mp-weixin/lib/uni.config.js
浏览文件 @
e61d3e9d
...
@@ -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
)
...
...
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
浏览文件 @
e61d3e9d
...
@@ -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
'
),
...
...
packages/vue-cli-plugin-uni/lib/mp/index.js
浏览文件 @
e61d3e9d
...
@@ -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
)
{
...
...
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
浏览文件 @
e61d3e9d
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录