Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李俊赕
self-support
Commits
dffe0a18
Commit
dffe0a18
authored
Jun 15, 2021
by
Damon
Browse files
Options
Browse Files
Download
Plain Diff
env
parents
7d8ca475
26f11c2b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
22 deletions
+43
-22
App.vue
src/App.vue
+43
-22
No files found.
src/App.vue
View file @
dffe0a18
...
...
@@ -70,8 +70,6 @@ export default {
// 应用初始化(全局只触发一次)
AnalysysAgent
.
registerSuperProperty
(
"platform"
,
"self-support"
);
this
.
getSystemInfo
();
// 版本更新
await
this
.
updateApp
();
// 系统自动登录::每次运行小程序重新获取用户信息
await
this
.
autoLogin
();
...
...
@@ -79,6 +77,8 @@ export default {
//this.deleteTempImg()
},
onShow
:
async
function
()
{
// 版本更新
await
this
.
updateApp
();
// 应用启动,或从后台进入前台显示
if
(
this
.
uploadTask
.
length
>
0
)
{
upload
.
uploadImageTask
(
this
)
...
...
@@ -168,11 +168,13 @@ export default {
/* 版本更新 */
async
updateApp
()
{
if
(
uni
.
canIUse
(
'getUpdateManager'
))
{
// 版本更新
const
updateManager
=
uni
.
getUpdateManager
();
updateManager
.
onCheckForUpdate
(
function
(
res
)
{
// 请求完新版本信息的回调
console
.
log
(
"update"
,
res
)
});
updateManager
.
onUpdateReady
(
function
(
res
)
{
...
...
@@ -182,7 +184,16 @@ export default {
success
(
res
)
{
if
(
res
.
confirm
)
{
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager
.
applyUpdate
();
updateManager
.
applyUpdate
()
}
else
if
(
res
.
cancel
)
{
//如果需要强制更新,则给出二次弹窗
uni
.
showModal
({
title
:
'温馨提示~'
,
content
:
'本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~'
,
success
:
function
(
res
)
{
updateManager
.
applyUpdate
()
}
})
}
},
});
...
...
@@ -190,7 +201,17 @@ export default {
updateManager
.
onUpdateFailed
(
function
(
res
)
{
// 新的版本下载失败
uni
.
showModal
({
title
:
'已经有新版本了哟~'
,
content
:
'新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
,
})
});
}
else
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
})
}
},
/* ------------------------- 数据埋点begin ------------------------------ */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment