|
@@ -1,42 +1,35 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<div class="right-modifyPsw">
|
|
|
- <div>
|
|
|
+ <div >
|
|
|
<div class="right-modifyPsw-title">
|
|
|
<span style="font-size: 18px;font-weight: bold">邮箱绑定</span>
|
|
|
</div>
|
|
|
- <div style="background-color: rgba(233,239,249,1);padding: 10px;margin-bottom: 30px" v-if="showBindWranning">
|
|
|
- <span style="font-size: 16px">您还未绑定邮箱,为保护您帐号,建议您</span>
|
|
|
- <el-button type="primary" plain size="mini" @click="bindingEmail = true;showBindWranning = false">立即绑定
|
|
|
- </el-button>
|
|
|
- <div>
|
|
|
- 邮箱绑定成功后,您将享受以下服务:
|
|
|
+ <div>
|
|
|
+ <div v-if="!user.email">
|
|
|
+ <div style="background-color: rgba(233,239,249,1);padding: 10px;margin-bottom: 30px" v-if="showBindWranning">
|
|
|
+ <img src="../../assets/img/phoneUnbinding.png"></img>
|
|
|
+ <span style="font-size: 16px">您还未绑定邮箱,为保护您帐号,建议您</span>
|
|
|
+ <el-button type="primary" plain size="mini" @click="handleBindingEmail">立即绑定
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 邮箱绑定成功后,您将享受以下服务:
|
|
|
+ </div>
|
|
|
+ <div>①邮箱地址登录 可直接使用“邮箱地址”登录到众测服务平台</div>
|
|
|
+ <div>②重要事件提醒 进行(支付/提现/众测/中标)时,可及时收到邮件提醒</div>
|
|
|
+ <div>③找回账号密码 忘记密码时,可使用邮件找回密码</div>
|
|
|
</div>
|
|
|
- <div>①邮箱地址登录 可直接使用“邮箱地址”登录到众测服务平台</div>
|
|
|
- <div>②重要事件提醒 进行(支付/提现/众测/中标)时,可及时收到邮件提醒</div>
|
|
|
- <div>③找回账号密码 忘记密码时,可使用邮件找回密码</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div v-if="!showBindWranning">
|
|
|
- <div style="background-color: rgba(233,239,249,1);padding: 10px;margin-bottom: 30px">
|
|
|
- <span style="font-size: 16px">您绑定的邮箱是:{{this.user.email}}</span>
|
|
|
+ <div v-if="user.email">
|
|
|
+ <div style="background-color: rgba(233,239,249,1);padding: 10px;margin-bottom: 30px">
|
|
|
+ <img src="../../assets/img/phoneBinding.png"></img>
|
|
|
+ <span style="font-size: 16px">您绑定的邮箱是:{{this.user.email}}</span>
|
|
|
+ <el-button type="primary" plain size="mini" @click="handleChangeEmail" style="margin-left: 20px">修改邮箱</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <router-view></router-view>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-if="bindingEmail">
|
|
|
- <el-form label-width="80px">
|
|
|
- <el-form-item label="邮箱号">
|
|
|
- <el-input v-model="emailBindingForm.email"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="验证码">
|
|
|
- <el-input placeholder="验证码内容" v-model="emailBindingForm.verifyCode" class="input-with-select">
|
|
|
- <el-button slot="append" @click="getVerifyCode">{{hasVerifyCode ? codeTime : '获取验证码'}}</el-button>
|
|
|
- </el-input>
|
|
|
- <span v-if="hasVerifyCode">验证码已发送到您手机上</span>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <el-button type="primary" plain style="margin-left: 80px" @click="handleBindingEmail">完成绑定</el-button>
|
|
|
- </div>
|
|
|
-
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -50,7 +43,7 @@
|
|
|
name: "MailBinding",
|
|
|
data() {
|
|
|
return {
|
|
|
- showBindWranning: true,
|
|
|
+ // showBindWranning: true,
|
|
|
hasVerifyCode: false,
|
|
|
bindingEmail: false,
|
|
|
codeTime: 10,
|
|
@@ -63,23 +56,22 @@
|
|
|
},
|
|
|
methods: {
|
|
|
setUserInfo() {
|
|
|
- this.user = storageGet('user') && storageGet('user').userVO;
|
|
|
- },
|
|
|
- handleBindingEmail() {
|
|
|
- let params = {
|
|
|
- "id": this.user.id,
|
|
|
- "email": this.emailBindingForm.email,
|
|
|
- 'verifyCode': this.emailBindingForm.verifyCode
|
|
|
- }
|
|
|
- Http.put('/api/user/email', params).then(res => {
|
|
|
- if (res.code === 20000) {
|
|
|
- notify('success', '绑定邮箱成功');
|
|
|
- //vuex storage 存数据
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- notify('error', '绑定邮箱失败:' + err.data);
|
|
|
+ let userId = storageGet('user')&&storageGet('user').userVO.id;
|
|
|
+ Http.get(`/api/user/${userId}`).then(res=>{
|
|
|
+ this.user = res.userVO
|
|
|
+ this.showBindWranning = !!this.user.email;
|
|
|
})
|
|
|
},
|
|
|
+ handleBindingEmail(){
|
|
|
+ this.$router.push({
|
|
|
+ path: '/personal/mailBinding/binding',
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleChangeEmail(){
|
|
|
+ this.$router.push({
|
|
|
+ path: '/personal/mailBinding/rebinding',
|
|
|
+ });
|
|
|
+ },
|
|
|
getVerifyCode() {
|
|
|
let params = {
|
|
|
id: this.user.id,
|
|
@@ -95,6 +87,7 @@
|
|
|
clearInterval(codeTimer);
|
|
|
_this.hasVerifyCode = false;
|
|
|
this.codeTime = 10;
|
|
|
+ this.setUserInfo()
|
|
|
}
|
|
|
}, 1000)
|
|
|
}).catch(err => {
|
|
@@ -103,7 +96,7 @@
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.showBindWranning = !!this.user.email;
|
|
|
+ console.log('aaa');
|
|
|
this.setUserInfo();
|
|
|
}
|
|
|
}
|