mirror of https://github.com/halo-dev/halo-admin
refactor: login page.
parent
c0392299e7
commit
c2feb69a10
|
@ -3,7 +3,10 @@
|
||||||
<div class="halo-logo animated fadeInUp">
|
<div class="halo-logo animated fadeInUp">
|
||||||
<span>Halo</span>
|
<span>Halo</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="animated">
|
<div
|
||||||
|
v-show="!apiModifyVisible"
|
||||||
|
class="login-form animated"
|
||||||
|
>
|
||||||
<a-form
|
<a-form
|
||||||
layout="vertical"
|
layout="vertical"
|
||||||
@keyup.enter.native="handleLogin"
|
@keyup.enter.native="handleLogin"
|
||||||
|
@ -61,32 +64,65 @@
|
||||||
</a>
|
</a>
|
||||||
</router-link>
|
</router-link>
|
||||||
<a
|
<a
|
||||||
@click="handleApiModifyModalOpen"
|
@click="toggleShowApiForm"
|
||||||
class="tip animated fadeInUp"
|
class="tip animated fadeInUp"
|
||||||
:style="{'animation-delay': '0.4s'}"
|
:style="{'animation-delay': '0.4s'}"
|
||||||
>
|
>
|
||||||
API 设置
|
<a-icon type="setting" />
|
||||||
</a>
|
</a>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
||||||
<a-modal
|
|
||||||
title="API 设置"
|
|
||||||
:visible="apiModifyVisible"
|
|
||||||
@ok="handleApiModifyOk"
|
|
||||||
@cancel="handleApiModifyCancel"
|
|
||||||
>
|
|
||||||
<a-form>
|
|
||||||
<a-form-item extra="如果 halo admin 不是独立部署,请不要更改此 API">
|
|
||||||
<a-input v-model="apiUrl"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
|
|
||||||
<a-form-item>
|
|
||||||
<a-button @click="handleApiUrlRestore">
|
|
||||||
恢复默认
|
|
||||||
</a-button>
|
|
||||||
</a-form-item>
|
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-modal>
|
</div>
|
||||||
|
<div
|
||||||
|
v-show="apiModifyVisible"
|
||||||
|
class="api-form animated"
|
||||||
|
>
|
||||||
|
<a-form layout="vertical">
|
||||||
|
<a-form-item
|
||||||
|
class="animated fadeInUp"
|
||||||
|
:style="{'animation-delay': '0.1s'}"
|
||||||
|
extra="* 如果 halo admin 不是独立部署,请不要更改此 API"
|
||||||
|
>
|
||||||
|
<a-input
|
||||||
|
placeholder="API 地址"
|
||||||
|
v-model="apiUrl"
|
||||||
|
>
|
||||||
|
<a-icon
|
||||||
|
slot="prefix"
|
||||||
|
type="api"
|
||||||
|
style="color: rgba(0,0,0,.25)"
|
||||||
|
/>
|
||||||
|
</a-input>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item
|
||||||
|
class="animated fadeInUp"
|
||||||
|
:style="{'animation-delay': '0.2s'}"
|
||||||
|
>
|
||||||
|
<a-button
|
||||||
|
:block="true"
|
||||||
|
@click="handleApiUrlRestore"
|
||||||
|
>恢复默认</a-button>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item
|
||||||
|
class="animated fadeInUp"
|
||||||
|
:style="{'animation-delay': '0.3s'}"
|
||||||
|
>
|
||||||
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
:block="true"
|
||||||
|
@click="handleApiModifyOk"
|
||||||
|
>保存设置</a-button>
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
<a-row>
|
||||||
|
<a
|
||||||
|
@click="toggleShowApiForm"
|
||||||
|
class="tip animated fadeInUp"
|
||||||
|
:style="{'animation-delay': '0.4s'}"
|
||||||
|
>
|
||||||
|
<a-icon type="rollback" />
|
||||||
|
</a>
|
||||||
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -149,21 +185,20 @@ export default {
|
||||||
this.$router.replace({ name: 'Dashboard' })
|
this.$router.replace({ name: 'Dashboard' })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleApiModifyModalOpen() {
|
|
||||||
this.apiUrl = this.defaultApiUrl
|
|
||||||
this.apiModifyVisible = true
|
|
||||||
},
|
|
||||||
handleApiModifyOk() {
|
handleApiModifyOk() {
|
||||||
this.setApiUrl(this.apiUrl)
|
this.setApiUrl(this.apiUrl)
|
||||||
this.apiModifyVisible = false
|
this.apiModifyVisible = false
|
||||||
},
|
},
|
||||||
handleApiModifyCancel() {
|
|
||||||
this.apiModifyVisible = false
|
|
||||||
},
|
|
||||||
handleApiUrlRestore() {
|
handleApiUrlRestore() {
|
||||||
this.restoreApiUrl()
|
this.restoreApiUrl()
|
||||||
this.apiUrl = this.defaultApiUrl
|
this.apiUrl = this.defaultApiUrl
|
||||||
},
|
},
|
||||||
|
toggleShowApiForm() {
|
||||||
|
this.apiModifyVisible = !this.apiModifyVisible
|
||||||
|
if (this.apiModifyVisible) {
|
||||||
|
this.apiUrl = this.defaultApiUrl
|
||||||
|
}
|
||||||
|
},
|
||||||
toggleHidden() {
|
toggleHidden() {
|
||||||
this.resetPasswordButton = !this.resetPasswordButton
|
this.resetPasswordButton = !this.resetPasswordButton
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue