加入长任务支持

This commit is contained in:
marvzhang
2020-02-19 13:17:01 +08:00
parent e4c012cf2f
commit 010f3ec1fa
9 changed files with 130 additions and 25 deletions

View File

@@ -1,5 +1,11 @@
import request from '../../api/request'
const state = {
version: ''
version: '',
latestRelease: {
name: '',
body: ''
}
}
const getters = {}
@@ -7,10 +13,20 @@ const getters = {}
const mutations = {
SET_VERSION: (state, value) => {
state.version = value
},
SET_LATEST_RELEASE: (state, value) => {
state.latestRelease = value
}
}
const actions = {}
const actions = {
async getLatestRelease ({ commit }) {
const res = await request.get('/releases/latest')
if (!res.data.error) {
commit('SET_LATEST_RELEASE', res.data.data)
}
}
}
export default {
namespaced: true,