-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d090ee8
commit b15cf22
Showing
7 changed files
with
228 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<template> | ||
<div class="active"> | ||
{{status}} | ||
<i v-if="activing" class="el-icon-loading"></i> | ||
<div> | ||
<el-button class="btn" size="small" v-if="valid"> | ||
<router-link tag="span" to="/">返回首页</router-link> | ||
</el-button> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from 'vue'; | ||
import Component from 'vue-class-component'; | ||
import { activateAccount } from '../../api/login' | ||
@Component({ | ||
name: 'Active', | ||
}) | ||
export default class Active extends Vue { | ||
private status: string = '激活中...'; | ||
private activing: boolean = true; | ||
private valid: boolean = false; | ||
public async activateAccoutn() { | ||
const res: any = await activateAccount(this.$route.params.id).catch(err => err); | ||
this.activing = false; | ||
if (res instanceof Error) { | ||
this.status = '网络错误, 请稍后再试.'; | ||
return; | ||
} | ||
if (!res || res.code === -1) { | ||
this.status = res.msg; | ||
return; | ||
}; | ||
this.status = '激活成功!回到首页登陆'; | ||
this.activing = false; | ||
this.valid = true; | ||
} | ||
public beforeMount() { | ||
if (!this.$route.params.id) { | ||
this.$router.push('/'); | ||
} | ||
} | ||
public async mounted() { | ||
await this.activateAccoutn() | ||
} | ||
} | ||
</script> | ||
<style lang="scss" scoped> | ||
.active { | ||
margin-top: 20px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 600px; | ||
.btn { | ||
background: #f2f3f7; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<template> | ||
<div class="error"> | ||
<div class="title">404</div> | ||
<div class="content">Not Found</div> | ||
<el-button class="btn" size="small"> | ||
<router-link to="/" tag="span">返回主页</router-link> | ||
</el-button> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from 'vue'; | ||
import Component from 'vue-class-component'; | ||
import { activateAccount } from '../../api/login' | ||
@Component({ | ||
name: 'NotFound', | ||
}) | ||
export default class NotFound extends Vue { | ||
} | ||
</script> | ||
<style lang="scss" scoped> | ||
.error { | ||
display: flex; | ||
height: 600px; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
.title { | ||
font-size: 40px; | ||
margin-bottom: 10px; | ||
} | ||
.content { | ||
font-size: 24px; | ||
margin-bottom: 10px; | ||
} | ||
.btn { | ||
background: #f2f3f7; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<template> | ||
<div class="staging"> | ||
<div class="title">Hi, {{name}}:</div> | ||
<div class="content"> | ||
<p>感谢你注册About Life! 我们发送了激活邮件到你的邮箱: {{email}}.</p> | ||
<p>请前往你的邮箱激活账户, 激活账户就可以正常登陆About Life啦!</p> | ||
</div> | ||
<div class="footer">--- About Life</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from 'vue'; | ||
import Component from 'vue-class-component'; | ||
@Component({ | ||
name: 'Staging', | ||
props: { | ||
email: { | ||
type: String, | ||
required: true | ||
}, | ||
name: { | ||
type: String, | ||
required: true | ||
} | ||
}, | ||
}) | ||
export default class Staging extends Vue { | ||
public beforeMount() { | ||
if (!this.$props.name || !this.$props.email) { | ||
this.$router.push('/') | ||
} | ||
} | ||
} | ||
</script> | ||
<style lang="scss" scoped> | ||
.staging { | ||
margin-top: 20px; | ||
.title { | ||
font-size: 18px; | ||
text-align: left; | ||
color: #d9d9d9; | ||
} | ||
.content { | ||
margin-top: 10px; | ||
p { | ||
margin-top: 5px; | ||
} | ||
} | ||
.footer { | ||
text-align: right; | ||
} | ||
} | ||
</style> |