更新
This commit is contained in:
parent
484ad91e20
commit
e5827a36ed
@ -2,8 +2,8 @@
|
||||
"name" : "里海社区管理系统",
|
||||
"appid" : "__UNI__B5B1EDD",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"versionName" : "1.0.4",
|
||||
"versionCode" : 104,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
|
@ -46,16 +46,17 @@ const actions = {
|
||||
async initConfig({ state, commit }, data = false) {
|
||||
let res = await getConfig();
|
||||
commit('SET_CONFIG', res.data);
|
||||
let os = uni.getSystemInfoSync();
|
||||
console.log(compareVersions(res.data.version, '1.0.0')==1&&compareVersions(res.data.version, Cache.get('wgt_version'))==1);
|
||||
// #ifdef APP-PLUS
|
||||
let os = uni.getSystemInfoSync();
|
||||
if(data) uni.showLoading({
|
||||
title: '检查更新中'
|
||||
})
|
||||
// 版本更新
|
||||
if(compareVersions(res.data.version, os.appVersion)==1){
|
||||
if(compareVersions(res.data.version, os.appVersion)==1&&compareVersions(res.data.version, Cache.get('wgt_version')||'1.0.0')==1){
|
||||
try{
|
||||
let info = res.data.version_info||{};
|
||||
info = {
|
||||
let version = {
|
||||
title: info.title||'发现新版本',
|
||||
content: info.content||'修复了部分BUG',
|
||||
versionName: info.version||'1.0.1',
|
||||
@ -63,7 +64,12 @@ const actions = {
|
||||
force: info.force==1?true:false, // 是否强制更新
|
||||
quiet: info.quiet==1?true:false // 是否静默更新
|
||||
}
|
||||
Updater.update(info);
|
||||
Updater.update(version);
|
||||
let suffix = ".wgt";
|
||||
if(info.dow_url.substring(info.dow_url.length - suffix.length, info.dow_url.length)==suffix){
|
||||
console.log('wgt update');
|
||||
Cache.set('wgt_version', info.version);
|
||||
}
|
||||
}catch(e){
|
||||
console.log(e);
|
||||
}
|
||||
|
@ -190,7 +190,7 @@
|
||||
async initLoad() {
|
||||
this.loadConfig.page = 1;
|
||||
this.loadConfig.status = "loadmore";
|
||||
this.companyList = [];
|
||||
this.list = [];
|
||||
await this.loadList();
|
||||
},
|
||||
async loadList(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user