Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yangkaifeng
uni-app
提交
3b58ad6d
U
uni-app
项目概览
yangkaifeng
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
3
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,发现更多精彩内容 >>
提交
3b58ad6d
编写于
11月 02, 2021
作者:
d-u-a
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
check update
上级
ccfb7f5a
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
53 addition
and
4 deletion
+53
-4
packages/vue-cli-plugin-uni/lib/check-update.js
packages/vue-cli-plugin-uni/lib/check-update.js
+53
-4
未找到文件。
packages/vue-cli-plugin-uni/lib/check-update.js
浏览文件 @
3b58ad6d
...
@@ -13,12 +13,14 @@ class Upate {
...
@@ -13,12 +13,14 @@ class Upate {
this
.
_isAlpha
=
false
this
.
_isAlpha
=
false
this
.
_uniId
=
''
this
.
_uniId
=
''
this
.
_appId
=
''
this
.
_appId
=
''
this
.
_wt
=
0
this
.
_lc
=
''
this
.
_lcin
=
[]
}
}
get
uniId
()
{
get
uniId
()
{
return
this
.
_uniId
return
this
.
_uniId
}
}
set
uniId
(
value
)
{
set
uniId
(
value
)
{
this
.
_uniId
=
value
this
.
_uniId
=
value
}
}
...
@@ -26,7 +28,6 @@ class Upate {
...
@@ -26,7 +28,6 @@ class Upate {
get
appId
()
{
get
appId
()
{
return
this
.
_appId
return
this
.
_appId
}
}
set
appId
(
value
)
{
set
appId
(
value
)
{
this
.
_appId
=
value
this
.
_appId
=
value
}
}
...
@@ -34,7 +35,6 @@ class Upate {
...
@@ -34,7 +35,6 @@ class Upate {
get
compilerVersion
()
{
get
compilerVersion
()
{
return
this
.
_compilerVersion
return
this
.
_compilerVersion
}
}
set
compilerVersion
(
value
)
{
set
compilerVersion
(
value
)
{
this
.
_compilerVersion
=
value
this
.
_compilerVersion
=
value
}
}
...
@@ -42,11 +42,31 @@ class Upate {
...
@@ -42,11 +42,31 @@ class Upate {
get
isAlpha
()
{
get
isAlpha
()
{
return
this
.
_isAlpha
return
this
.
_isAlpha
}
}
set
isAlpha
(
value
)
{
set
isAlpha
(
value
)
{
this
.
_isAlpha
=
value
this
.
_isAlpha
=
value
}
}
get
wt
()
{
return
this
.
_wt
}
set
wt
(
value
)
{
this
.
_wt
=
value
}
get
lc
()
{
return
this
.
_lc
}
set
lc
(
value
)
{
this
.
_lc
=
value
}
get
lcin
()
{
return
this
.
_lcin
}
set
lcin
(
value
)
{
this
.
_lcin
=
value
}
get
versionType
()
{
get
versionType
()
{
return
(
this
.
isAlpha
?
'
a
'
:
'
r
'
)
return
(
this
.
isAlpha
?
'
a
'
:
'
r
'
)
}
}
...
@@ -156,6 +176,9 @@ class Upate {
...
@@ -156,6 +176,9 @@ class Upate {
data
.
appid
=
this
.
uniId
data
.
appid
=
this
.
uniId
data
.
vtype
=
this
.
versionType
data
.
vtype
=
this
.
versionType
data
.
vcode
=
this
.
compilerVersion
data
.
vcode
=
this
.
compilerVersion
data
.
wt
=
this
.
_wt
data
.
lc
=
this
.
_lc
data
.
in
=
this
.
_lcin
delete
data
.
lastCheck
delete
data
.
lastCheck
...
@@ -234,6 +257,28 @@ Object.assign(Upate.prototype, {
...
@@ -234,6 +257,28 @@ Object.assign(Upate.prototype, {
DEFAULT_INTERVAL
:
1000
*
60
*
60
*
24
DEFAULT_INTERVAL
:
1000
*
60
*
60
*
24
})
})
function
getLc
()
{
let
result
=
[]
const
locale_dir
=
path
.
join
(
process
.
env
.
UNI_CLI_CONTEXT
,
'
src/locale
'
)
if
(
!
fs
.
existsSync
(
locale_dir
))
{
return
result
}
let
files
=
fs
.
readdirSync
(
locale_dir
)
for
(
let
i
=
files
.
length
-
1
;
i
>=
0
;
i
--
)
{
let
filePath
=
files
[
i
]
let
extName
=
filePath
.
substring
(
filePath
.
lastIndexOf
(
'
.
'
)
+
1
).
toLowerCase
()
if
(
extName
!==
'
json
'
)
{
continue
}
if
(
files
[
i
].
indexOf
(
'
uni-app.
'
)
<
0
)
{
result
.
push
(
filePath
.
substring
(
0
,
filePath
.
lastIndexOf
(
'
.
'
)))
}
}
return
result
}
module
.
exports
=
async
function
checkUpdate
()
{
module
.
exports
=
async
function
checkUpdate
()
{
const
{
const
{
isInHBuilderX
,
isInHBuilderX
,
...
@@ -255,6 +300,10 @@ module.exports = async function checkUpdate () {
...
@@ -255,6 +300,10 @@ module.exports = async function checkUpdate () {
update
.
uniId
=
manifest
.
appid
update
.
uniId
=
manifest
.
appid
const
appIdKey
=
process
.
env
.
UNI_PLATFORM
.
includes
(
'
quickapp
'
)
?
'
package
'
:
'
appid
'
const
appIdKey
=
process
.
env
.
UNI_PLATFORM
.
includes
(
'
quickapp
'
)
?
'
package
'
:
'
appid
'
update
.
appId
=
manifest
[
process
.
env
.
UNI_PLATFORM
]
?
(
manifest
[
process
.
env
.
UNI_PLATFORM
][
appIdKey
]
||
''
)
:
''
update
.
appId
=
manifest
[
process
.
env
.
UNI_PLATFORM
]
?
(
manifest
[
process
.
env
.
UNI_PLATFORM
][
appIdKey
]
||
''
)
:
''
const
cf
=
manifest
[
'
mp-weixin
'
]
?
manifest
[
'
mp-weixin
'
][
'
cloudfunctionRoot
'
]
:
''
update
.
wt
=
(
cf
&&
cf
.
length
)
?
1
:
0
update
.
lc
=
manifest
[
'
locale
'
]
?
manifest
[
'
locale
'
]
:
''
update
.
lcin
=
getLc
().
join
(
'
,
'
)
update
.
check
()
update
.
check
()
}
catch
(
e
)
{
}
catch
(
e
)
{
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录