You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
986 B
46 lines
986 B
import { getNewApp, listByIds } from '@/api/indexpage/user.js';
|
|
const updateApp = {
|
|
state: {
|
|
MiaoShu: null,
|
|
newVesion: null,
|
|
isTrue: false,
|
|
id: null,
|
|
url: null
|
|
},
|
|
|
|
mutations: {
|
|
setState: (state, data) => {
|
|
state.MiaoShu = data.content
|
|
state.newVesion = data.version,
|
|
state.id = data.url
|
|
},
|
|
setisTrue: (state) => {
|
|
state.isTrue = true
|
|
},
|
|
setisFalse: (state) => {
|
|
state.isTrue = false
|
|
// console.log(1111);
|
|
},
|
|
setUrl: (state, url) => {
|
|
state.url = url
|
|
},
|
|
},
|
|
actions: {
|
|
//获取版本号,和新版本的下载链接
|
|
getNewsApplist({ commit }) {
|
|
getNewApp().then(res => {
|
|
console.log(res);
|
|
commit("setState", res.data)
|
|
//获取本地app版本号与更新版本号对比
|
|
let oldVeions = getApp().globalData.config.appInfo.version
|
|
// console.log(oldVeions);
|
|
if (res.data.version !== oldVeions) {
|
|
commit("setUrl", res.data.url)
|
|
commit("setisTrue")
|
|
}
|
|
});
|
|
},
|
|
},
|
|
}
|
|
|
|
export default updateApp |