refactor: static pages generate and deploy method.

pull/3445/head
ruibaby 2019-12-26 20:38:50 +08:00
parent 876cefe572
commit ba41617e6a
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()
.then(response => {
this.$message.success('生成成功!') this.$message.success('生成成功!')
})
.finally(response => {
this.loadStaticPageList() 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()
})
} }
} }
} }