diff --git a/src/views/system/Installation.vue b/src/views/system/Installation.vue index f9d687ea..35aae80b 100644 --- a/src/views/system/Installation.vue +++ b/src/views/system/Installation.vue @@ -32,11 +32,16 @@ 下一步 import adminApi from '@/api/admin' +import optionApi from '@/api/option' import recoveryApi from '@/api/recovery' export default { @@ -225,13 +243,34 @@ export default { installation: {}, migrationUploadName: 'file', migrationData: null, - stepCurrent: 0 + stepCurrent: 0, + bloggerForm: this.$form.createForm(this), + keys: ['is_installed'] } }, created() { + this.verifyIsInstall() this.installation.url = window.location.protocol + '//' + window.location.host }, methods: { + verifyIsInstall() { + optionApi.listAll(this.keys).then(response => { + if(response.data.data.is_installed){ + this.$router.push({ name: 'Login' }) + } + }) + }, + handleNextStep(e) { + e.preventDefault() + this.bloggerForm.validateFields((error, values) => { + console.log('error', error) + console.log('Received values of form: ', values) + if (error != null) { + } else { + this.stepCurrent++ + } + }) + }, handleMigrationUpload(data) { this.$log.debug('Selected data', data) this.migrationData = data