This commit is contained in:
weipengfei 2023-09-01 10:11:49 +08:00
parent 484ad91e20
commit e5827a36ed
3 changed files with 13 additions and 7 deletions

View File

@ -2,8 +2,8 @@
"name" : "里海社区管理系统", "name" : "里海社区管理系统",
"appid" : "__UNI__B5B1EDD", "appid" : "__UNI__B5B1EDD",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.4",
"versionCode" : "100", "versionCode" : 104,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

View File

@ -46,16 +46,17 @@ const actions = {
async initConfig({ state, commit }, data = false) { async initConfig({ state, commit }, data = false) {
let res = await getConfig(); let res = await getConfig();
commit('SET_CONFIG', res.data); 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 // #ifdef APP-PLUS
let os = uni.getSystemInfoSync();
if(data) uni.showLoading({ if(data) uni.showLoading({
title: '检查更新中' 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{ try{
let info = res.data.version_info||{}; let info = res.data.version_info||{};
info = { let version = {
title: info.title||'发现新版本', title: info.title||'发现新版本',
content: info.content||'修复了部分BUG', content: info.content||'修复了部分BUG',
versionName: info.version||'1.0.1', versionName: info.version||'1.0.1',
@ -63,7 +64,12 @@ const actions = {
force: info.force==1?true:false, // 是否强制更新 force: info.force==1?true:false, // 是否强制更新
quiet: info.quiet==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){ }catch(e){
console.log(e); console.log(e);
} }

View File

@ -190,7 +190,7 @@
async initLoad() { async initLoad() {
this.loadConfig.page = 1; this.loadConfig.page = 1;
this.loadConfig.status = "loadmore"; this.loadConfig.status = "loadmore";
this.companyList = []; this.list = [];
await this.loadList(); await this.loadList();
}, },
async loadList(){ async loadList(){