Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
genary
uni-app
提交
a16f0337
U
uni-app
项目概览
genary
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a16f0337
编写于
7月 29, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: yarn.lock
上级
14514ad0
变更
14
展开全部
隐藏空白更改
内联
并排
Showing
14 changed file
with
1496 addition
and
190 deletion
+1496
-190
.prettierignore
.prettierignore
+2
-1
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+4
-3
packages/uni-cloud/dist/uni-cloud.cjs.js
packages/uni-cloud/dist/uni-cloud.cjs.js
+0
-1
packages/uni-cloud/dist/uni-cloud.es.js
packages/uni-cloud/dist/uni-cloud.es.js
+0
-1
packages/uni-cloud/lib/uni.plugin.js
packages/uni-cloud/lib/uni.plugin.js
+85
-94
packages/uni-cloud/lib/validateFunction.js
packages/uni-cloud/lib/validateFunction.js
+14
-14
packages/uni-mp-alipay/dist/uni.api.esm.js
packages/uni-mp-alipay/dist/uni.api.esm.js
+1
-1
packages/uni-mp-baidu/dist/uni.api.esm.js
packages/uni-mp-baidu/dist/uni.api.esm.js
+1
-1
packages/uni-mp-qq/dist/uni.api.esm.js
packages/uni-mp-qq/dist/uni.api.esm.js
+1
-1
packages/uni-mp-toutiao/dist/uni.api.esm.js
packages/uni-mp-toutiao/dist/uni.api.esm.js
+1
-1
packages/uni-mp-weixin/dist/uni.api.esm.js
packages/uni-mp-weixin/dist/uni.api.esm.js
+1
-1
packages/uni-quickapp-webview/dist/uni.api.esm.js
packages/uni-quickapp-webview/dist/uni.api.esm.js
+1
-1
scripts/utils.js
scripts/utils.js
+1
-0
yarn.lock
yarn.lock
+1384
-70
未找到文件。
.prettierignore
浏览文件 @
a16f0337
...
...
@@ -4,4 +4,5 @@ packages/uni-app-vue/lib
packages/uni-cli-nvue/lib
packages/uni-cli-shared/lib
packages/uni-components/lib
packages/uni-mp-vue/lib
\ No newline at end of file
packages/uni-mp-vue/lib
packages/uni-cloud/lib
\ No newline at end of file
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
a16f0337
...
...
@@ -1711,12 +1711,13 @@ var serviceContext = (function (vue) {
liveEvents.length ? (e[name] = liveEvents) : delete e[name];
return this;
},
};
};
var Emitter = E;
// TODO 等待 vue3 的兼容模式自带emitter
function initBridge(subscribeNamespace) {
// TODO vue3 compatibility builds
const emitter = new E();
const emitter = new E
mitter
();
return {
on(event, callback) {
return emitter.on(event, callback);
...
...
@@ -2341,7 +2342,7 @@ var serviceContext = (function (vue) {
},
];
const emitter = new E();
const emitter = new E
mitter
();
const $on = defineSyncApi(API_ON, (name, callback) => {
emitter.on(name, callback);
return () => emitter.off(name, callback);
...
...
packages/uni-cloud/dist/uni-cloud.cjs.js
已删除
100644 → 0
浏览文件 @
14514ad0
此差异已折叠。
点击以展开。
packages/uni-cloud/dist/uni-cloud.es.js
已删除
100644 → 0
浏览文件 @
14514ad0
此差异已折叠。
点击以展开。
packages/uni-cloud/lib/uni.plugin.js
浏览文件 @
a16f0337
'
use strict
'
Object
.
defineProperty
(
exports
,
'
__esModule
'
,
{
value
:
true
})
const
uni_shared_1
=
require
(
'
@dcloudio/uni-shared
'
)
const
uni_cli_shared_1
=
require
(
'
@dcloudio/uni-cli-shared
'
)
const
validateFunction_1
=
require
(
'
./validateFunction
'
)
process
.
env
.
UNI_CLOUD_PROVIDER
=
JSON
.
stringify
([])
const
uniCloudSpaces
=
[]
initUniCloudEnv
()
"
use strict
"
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
const
uni_shared_1
=
require
(
"
@dcloudio/uni-shared
"
);
const
uni_cli_shared_1
=
require
(
"
@dcloudio/uni-cli-shared
"
);
const
validateFunction_1
=
require
(
"
./validateFunction
"
);
process
.
env
.
UNI_CLOUD_PROVIDER
=
JSON
.
stringify
([])
;
const
uniCloudSpaces
=
[]
;
initUniCloudEnv
()
;
/**
* @type {import('vite').Plugin}
*/
const
UniCloudPlugin
=
{
name
:
'
vite:uni-cloud
'
,
config
(
config
)
{
const
silent
=
config
.
build
&&
config
.
build
.
ssr
?
true
:
false
if
(
silent
)
{
return
}
const
len
=
uniCloudSpaces
.
length
if
(
!
len
)
{
return
}
if
(
len
===
1
)
{
console
.
log
(
`本项目的uniCloud使用的默认服务空间spaceId为:
${
uniCloudSpaces
[
0
].
id
}
`
)
}
if
(
process
.
env
.
UNI_PLATFORM
===
'
h5
'
&&
!
process
.
env
.
UNI_SUB_PLATFORM
&&
process
.
env
.
NODE_ENV
===
'
production
'
)
{
console
.
warn
(
'
发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5
'
)
}
return
{}
},
configureServer
(
server
)
{
if
(
server
.
httpServer
)
{
server
.
httpServer
.
on
(
'
listening
'
,
()
=>
{
process
.
nextTick
(()
=>
{
initUniCloudWarningOnce
()
})
})
}
else
{
initUniCloudWarningOnce
()
}
},
closeBundle
()
{
if
(
process
.
env
.
UNI_PLATFORM
===
'
h5
'
&&
!
process
.
env
.
UNI_SSR_CLIENT
)
{
console
.
log
()
console
.
log
(
'
欢迎将H5站部署到uniCloud前端网页托管平台,高速、免费、安全、省心,详见:
'
)
console
.
log
(
'
https://uniapp.dcloud.io/uniCloud/hosting
'
)
}
},
}
name
:
'
vite:uni-cloud
'
,
config
(
config
)
{
const
silent
=
config
.
build
&&
config
.
build
.
ssr
?
true
:
false
;
if
(
silent
)
{
return
;
}
const
len
=
uniCloudSpaces
.
length
;
if
(
!
len
)
{
return
;
}
if
(
len
===
1
)
{
console
.
log
(
`本项目的uniCloud使用的默认服务空间spaceId为:
${
uniCloudSpaces
[
0
].
id
}
`
);
}
if
(
process
.
env
.
UNI_PLATFORM
===
'
h5
'
&&
!
process
.
env
.
UNI_SUB_PLATFORM
&&
process
.
env
.
NODE_ENV
===
'
production
'
)
{
console
.
warn
(
'
发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5
'
);
}
return
{};
},
configureServer
(
server
)
{
if
(
server
.
httpServer
)
{
server
.
httpServer
.
on
(
'
listening
'
,
()
=>
{
process
.
nextTick
(()
=>
{
initUniCloudWarningOnce
();
});
});
}
else
{
initUniCloudWarningOnce
();
}
},
closeBundle
()
{
if
(
process
.
env
.
UNI_PLATFORM
===
'
h5
'
&&
!
process
.
env
.
UNI_SSR_CLIENT
)
{
console
.
log
();
console
.
log
(
'
欢迎将H5站部署到uniCloud前端网页托管平台,高速、免费、安全、省心,详见:
'
);
console
.
log
(
'
https://uniapp.dcloud.io/uniCloud/hosting
'
);
}
},
};
const
initUniCloudWarningOnce
=
uni_shared_1
.
once
(()
=>
{
uniCloudSpaces
.
length
&&
console
.
warn
(
'
当前项目使用了uniCloud,为避免云函数调用跨域问题,建议在HBuilderX内置浏览器里调试,如使用外部浏览器需处理跨域,详见:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5
'
)
})
uniCloudSpaces
.
length
&&
console
.
warn
(
'
当前项目使用了uniCloud,为避免云函数调用跨域问题,建议在HBuilderX内置浏览器里调试,如使用外部浏览器需处理跨域,详见:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5
'
);
});
function
initUniCloudEnv
()
{
if
(
!
process
.
env
.
UNI_CLOUD_SPACES
)
{
return
}
try
{
const
spaces
=
JSON
.
parse
(
process
.
env
.
UNI_CLOUD_SPACES
)
if
(
!
Array
.
isArray
(
spaces
))
{
return
if
(
!
process
.
env
.
UNI_CLOUD_SPACES
)
{
return
;
}
spaces
.
forEach
((
s
)
=>
uniCloudSpaces
.
push
(
s
))
process
.
env
.
UNI_CLOUD_PROVIDER
=
JSON
.
stringify
(
uniCloudSpaces
.
map
((
space
)
=>
{
if
(
space
.
clientSecret
)
{
return
{
provider
:
'
aliyun
'
,
spaceName
:
space
.
name
,
spaceId
:
space
.
id
,
clientSecret
:
space
.
clientSecret
,
endpoint
:
space
.
apiEndpoint
,
}
}
else
{
return
{
provider
:
'
tencent
'
,
spaceName
:
space
.
name
,
spaceId
:
space
.
id
,
}
try
{
const
spaces
=
JSON
.
parse
(
process
.
env
.
UNI_CLOUD_SPACES
);
if
(
!
Array
.
isArray
(
spaces
))
{
return
;
}
})
)
}
catch
(
e
)
{}
spaces
.
forEach
((
s
)
=>
uniCloudSpaces
.
push
(
s
));
process
.
env
.
UNI_CLOUD_PROVIDER
=
JSON
.
stringify
(
uniCloudSpaces
.
map
((
space
)
=>
{
if
(
space
.
clientSecret
)
{
return
{
provider
:
'
aliyun
'
,
spaceName
:
space
.
name
,
spaceId
:
space
.
id
,
clientSecret
:
space
.
clientSecret
,
endpoint
:
space
.
apiEndpoint
,
};
}
else
{
return
{
provider
:
'
tencent
'
,
spaceName
:
space
.
name
,
spaceId
:
space
.
id
,
};
}
}));
}
catch
(
e
)
{
}
}
exports
.
default
=
[
UniCloudPlugin
,
uni_cli_shared_1
.
uniViteInjectPlugin
({
exclude
:
[...
uni_cli_shared_1
.
COMMON_EXCLUDE
],
uniCloud
:
[
'
@dcloudio/uni-cloud
'
,
'
default
'
],
}),
validateFunction_1
.
uniValidateFunctionPlugin
(),
]
UniCloudPlugin
,
uni_cli_shared_1
.
uniViteInjectPlugin
({
exclude
:
[...
uni_cli_shared_1
.
COMMON_EXCLUDE
],
uniCloud
:
[
'
@dcloudio/uni-cloud
'
,
'
default
'
],
}),
validateFunction_1
.
uniValidateFunctionPlugin
(),
]
;
packages/uni-cloud/lib/validateFunction.js
浏览文件 @
a16f0337
'
use strict
'
Object
.
defineProperty
(
exports
,
'
__esModule
'
,
{
value
:
true
})
exports
.
uniValidateFunctionPlugin
=
void
0
"
use strict
"
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
exports
.
uniValidateFunctionPlugin
=
void
0
;
function
replaceModuleExports
(
code
)
{
return
code
.
replace
(
/module
\.
exports
\s
*=/
,
'
export default
'
)
return
code
.
replace
(
/module
\.
exports
\s
*=/
,
'
export default
'
);
}
function
uniValidateFunctionPlugin
()
{
return
{
name
:
'
vite:uni-cloud-vf
'
,
enforce
:
'
pre
'
,
transform
(
code
,
id
)
{
if
(
id
.
includes
(
'
validator/validateFunction
'
))
{
return
replaceModuleExports
(
code
)
}
},
}
return
{
name
:
'
vite:uni-cloud-vf
'
,
enforce
:
'
pre
'
,
transform
(
code
,
id
)
{
if
(
id
.
includes
(
'
validator/validateFunction
'
))
{
return
replaceModuleExports
(
code
);
}
},
};
}
exports
.
uniValidateFunctionPlugin
=
uniValidateFunctionPlugin
exports
.
uniValidateFunctionPlugin
=
uniValidateFunctionPlugin
;
packages/uni-mp-alipay/dist/uni.api.esm.js
浏览文件 @
a16f0337
...
...
@@ -1255,4 +1255,4 @@ var protocols = /*#__PURE__*/Object.freeze({
var
index
=
initUni
(
shims
,
protocols
);
export
default
index
;
export
{
index
as
default
}
;
packages/uni-mp-baidu/dist/uni.api.esm.js
浏览文件 @
a16f0337
...
...
@@ -825,4 +825,4 @@ var protocols = /*#__PURE__*/Object.freeze({
var
index
=
initUni
(
shims
,
protocols
);
export
default
index
;
export
{
index
as
default
}
;
packages/uni-mp-qq/dist/uni.api.esm.js
浏览文件 @
a16f0337
...
...
@@ -726,4 +726,4 @@ var protocols = /*#__PURE__*/Object.freeze({
var
index
=
initUni
(
shims
,
protocols
);
export
default
index
;
export
{
index
as
default
}
;
packages/uni-mp-toutiao/dist/uni.api.esm.js
浏览文件 @
a16f0337
...
...
@@ -791,4 +791,4 @@ var protocols = /*#__PURE__*/Object.freeze({
var
index
=
initUni
(
shims
,
protocols
);
export
default
index
;
export
{
index
as
default
}
;
packages/uni-mp-weixin/dist/uni.api.esm.js
浏览文件 @
a16f0337
...
...
@@ -689,4 +689,4 @@ var protocols = /*#__PURE__*/Object.freeze({
var
index
=
initUni
(
shims
,
protocols
);
export
default
index
;
export
{
index
as
default
}
;
packages/uni-quickapp-webview/dist/uni.api.esm.js
浏览文件 @
a16f0337
...
...
@@ -733,4 +733,4 @@ var protocols = /*#__PURE__*/Object.freeze({
var
index
=
initUni
(
shims
,
protocols
);
export
default
index
;
export
{
index
as
default
}
;
scripts/utils.js
浏览文件 @
a16f0337
...
...
@@ -21,6 +21,7 @@ const priority = {
'
uni-app-plus
'
:
30
,
'
uni-app-vite
'
:
30
,
'
vite-plugin-uni
'
:
20
,
'
uni-cloud
'
:
10
,
'
size-check
'
:
1
,
}
...
...
yarn.lock
浏览文件 @
a16f0337
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录