refactor: static pages generate and deploy method.

pull/62/head
ruibaby 2019-12-26 20:38:50 +08:00
parent 4b47e2519a
commit cab0dbef32
1 changed files with 18 additions and 10 deletions

View File

@ -85,20 +85,28 @@ export default {
handleGenerate() { handleGenerate() {
this.loading = true this.loading = true
const hide = this.$message.loading('生成中...', 0) const hide = this.$message.loading('生成中...', 0)
staticPageApi.generate().then(response => { staticPageApi
hide() .generate()
this.$message.success('生成成功!') .then(response => {
this.loadStaticPageList() this.$message.success('生成成功!')
}) })
.finally(response => {
this.loadStaticPageList()
hide()
})
}, },
handleDeploy() { handleDeploy() {
this.deployLoading = true this.deployLoading = true
const hide = this.$message.loading('部署中...', 0) const hide = this.$message.loading('部署中...', 0)
staticPageApi.deploy().then(response => { staticPageApi
hide() .deploy()
this.deployLoading = false .then(response => {
this.$message.success('部署成功!') this.$message.success('部署成功!')
}) })
.finally(response => {
this.deployLoading = false
hide()
})
} }
} }
} }