Fixed install error.

pull/40/head
ruibaby 2019-08-24 11:40:36 +08:00
parent f0938b24d7
commit 4669fb54e5
2 changed files with 15 additions and 25 deletions

View File

@ -12,6 +12,13 @@ adminApi.counts = () => {
}) })
} }
adminApi.isInstalled = () => {
return service({
url: `${baseUrl}/is_installed`,
method: 'get'
})
}
adminApi.environments = () => { adminApi.environments = () => {
return service({ return service({
url: `${baseUrl}/environments`, url: `${baseUrl}/environments`,

View File

@ -1,10 +1,10 @@
<template> <template>
<div> <div>
<a-row <a-row
class="height-100"
type="flex" type="flex"
justify="center" justify="center"
align="middle" align="middle"
style="height: 100vh;"
> >
<a-col <a-col
:xl="8" :xl="8"
@ -16,7 +16,7 @@
<a-card <a-card
:bordered="false" :bordered="false"
title="Halo 安装向导" title="Halo 安装向导"
class="install-card" style="box-shadow: 0px 10px 20px 0px rgba(236, 236, 236, 0.86);"
> >
<a-steps :current="stepCurrent"> <a-steps :current="stepCurrent">
@ -189,12 +189,14 @@
class="install-action" class="install-action"
type="flex" type="flex"
justify="space-between" justify="space-between"
style="margin-top: 1rem;"
> >
<div> <div>
<a-button <a-button
class="previus-button" class="previus-button"
v-if="stepCurrent != 0" v-if="stepCurrent != 0"
@click="stepCurrent--" @click="stepCurrent--"
style="margin-right: 1rem;"
>上一步</a-button> >上一步</a-button>
<a-button <a-button
type="primary" type="primary"
@ -218,7 +220,6 @@
<script> <script>
import adminApi from '@/api/admin' import adminApi from '@/api/admin'
import optionApi from '@/api/option'
import recoveryApi from '@/api/recovery' import recoveryApi from '@/api/recovery'
export default { export default {
@ -244,8 +245,7 @@ export default {
migrationUploadName: 'file', migrationUploadName: 'file',
migrationData: null, migrationData: null,
stepCurrent: 0, stepCurrent: 0,
bloggerForm: this.$form.createForm(this), bloggerForm: this.$form.createForm(this)
keys: ['is_installed']
} }
}, },
created() { created() {
@ -254,8 +254,8 @@ export default {
}, },
methods: { methods: {
verifyIsInstall() { verifyIsInstall() {
optionApi.listAll(this.keys).then(response => { adminApi.isInstalled().then(response => {
if (response.data.data.is_installed) { if (response.data.data) {
this.$router.push({ name: 'Login' }) this.$router.push({ name: 'Login' })
} }
}) })
@ -292,7 +292,7 @@ export default {
this.$log.debug('Installation response', response) this.$log.debug('Installation response', response)
this.$message.success('安装成功!') this.$message.success('安装成功!')
setTimeout(() => { setTimeout(() => {
this.$router.push({ name: 'Dashboard' }) this.$router.push({ name: 'Login' })
}, 300) }, 300)
}) })
}, },
@ -322,20 +322,3 @@ export default {
} }
} }
</script> </script>
<style lang="less" scoped>
.height-100 {
height: 100vh;
}
.install-action {
margin-top: 1rem;
}
.previus-button {
margin-right: 1rem;
}
.install-card {
box-shadow: 0px 10px 20px 0px rgba(236, 236, 236, 0.86);
}
</style>