7 changed files with 259 additions and 87 deletions
@ -0,0 +1,3 @@ |
|||||
|
<template> |
||||
|
<h3 style="textAlign:center">请先登陆</h3> |
||||
|
</template> |
@ -0,0 +1,92 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<a @click="show" style="cursor: pointer;"> 登陆</a> |
||||
|
<modal |
||||
|
:show.sync="visible" |
||||
|
body-classes="p-0" |
||||
|
modal-classes="modal-dialog-centered modal-xl" |
||||
|
> |
||||
|
<card |
||||
|
type="secondary" |
||||
|
header-classes="bg-white pb-5" |
||||
|
body-classes="px-lg-5 py-lg-5" |
||||
|
class="border-0 mb-0" |
||||
|
style="padding:0 60px" |
||||
|
> |
||||
|
<!-- <template> |
||||
|
<div class="text-muted text-center mb-3"> |
||||
|
<small>Sign in with</small> |
||||
|
</div> |
||||
|
<div class="btn-wrapper text-center"> |
||||
|
<base-button type="default"> |
||||
|
<img |
||||
|
slot="icon" |
||||
|
src="https://demos.creative-tim.com/argon-design-system/assets/img/icons/common/github.svg" |
||||
|
/> |
||||
|
微信 |
||||
|
</base-button> |
||||
|
|
||||
|
<base-button type="danger"> |
||||
|
<img |
||||
|
slot="icon" |
||||
|
src="https://demos.creative-tim.com/argon-design-system/assets/img/icons/common/google.svg" |
||||
|
/> |
||||
|
QQ |
||||
|
</base-button> |
||||
|
</div> |
||||
|
</template> --> |
||||
|
<template> |
||||
|
<div class="text-center text-muted mb-4"> |
||||
|
<small>请使用账号密码登陆</small> |
||||
|
</div> |
||||
|
<form role="form"> |
||||
|
<base-input class="mb-3" placeholder="账号" v-model="form.account"> |
||||
|
</base-input> |
||||
|
<base-input |
||||
|
type="password" |
||||
|
placeholder="密码" |
||||
|
v-model="form.password" |
||||
|
> |
||||
|
</base-input> |
||||
|
<base-checkbox v-model="rememberMe"> |
||||
|
记住我 |
||||
|
</base-checkbox> |
||||
|
<div class="text-center"> |
||||
|
<base-button type="primary" class="my-4" @click="login" |
||||
|
>登陆</base-button |
||||
|
> |
||||
|
</div> |
||||
|
</form> |
||||
|
</template> |
||||
|
</card> |
||||
|
</modal> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import Modal from "../../components/Modal"; |
||||
|
export default { |
||||
|
components: { Modal }, |
||||
|
data() { |
||||
|
return { |
||||
|
visible: false, |
||||
|
form: {}, |
||||
|
rememberMe: false |
||||
|
}; |
||||
|
}, |
||||
|
methods: { |
||||
|
show() { |
||||
|
console.log(this.visible); |
||||
|
this.visible = true; |
||||
|
}, |
||||
|
login() { |
||||
|
if (this.rememberMe) { |
||||
|
localStorage.setItem("robotAccount", this.form.account); |
||||
|
localStorage.setItem("robotPassword", this.form.password); |
||||
|
} |
||||
|
localStorage.setItem("robotToken", "123"); |
||||
|
this.$emit("login", true); |
||||
|
}, |
||||
|
request() {} |
||||
|
} |
||||
|
}; |
||||
|
</script> |
Loading…
Reference in new issue