Browse Source

fix:修改邮件逻辑

old
wangqing 4 years ago
parent
commit
e6e966250a
  1. 2
      src/router/modules/root.js
  2. 20
      src/views/account/validate.vue

2
src/router/modules/root.js

@ -11,7 +11,7 @@ export default [
}, },
{ {
path: '/account/validate', path: '/account/validate',
meta: {requireLogin: true}, meta: {requireLogin: false},
component: () => import(/* webpackChunkName: 'root' */ '@/views/account/validate') component: () => import(/* webpackChunkName: 'root' */ '@/views/account/validate')
}, },
{ {

20
src/views/account/validate.vue

@ -11,6 +11,17 @@
/> />
<el-button style="width: 50%;" @click="$router.push({path: '/home'})">返回首页</el-button> <el-button style="width: 50%;" @click="$router.push({path: '/home'})">返回首页</el-button>
</div> </div>
<div v-else style="display: flex; flex-direction: column; align-items: center;">
<el-alert
title="绑定成功"
type="success"
:closable="false"
:center="true"
description="你现在可以通过邮箱登录"
show-icon
/>
<el-button style="width: 50%;" @click="$router.push({path: '/home'})">返回首页</el-button>
</div>
</div> </div>
</template> </template>
@ -22,7 +33,7 @@ export default {
name: 'Redirect', name: 'Redirect',
data() { data() {
return { return {
bindEmailErr: '' bindEmailErr: true
} }
}, },
created() { created() {
@ -32,9 +43,7 @@ export default {
let code = this.$route.query.code let code = this.$route.query.code
let email = this.$route.query.email let email = this.$route.query.email
this.$api.post('/user/update/email', {email: email, key: code}).then(res => { this.$api.post('/user/update/email', {email: email, key: code}).then(res => {
if (!res.data) { this.bindEmailErr = !res.data
this.bindEmailErr = true
}
}) })
} }
}, },
@ -52,7 +61,8 @@ export default {
justify-items: center; justify-items: center;
align-items: center; align-items: center;
} }
.el-alert--error.is-light { .el-alert--error.is-light,
.el-alert--success.is-light {
background-color: transparent; background-color: transparent;
} }
.el-alert { .el-alert {

Loading…
Cancel
Save