Commit 8bdedc5d authored by 杨梦雪's avatar 杨梦雪

注册发送邮箱

parent cce550be
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
v-model="phone" v-model="phone"
placeholder="请输入手机号" placeholder="请输入手机号"
size="small" size="small"
disabled="true" :disabled="true"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
v-model="referForm.email" v-model="referForm.email"
placeholder="填写电子邮箱" placeholder="填写电子邮箱"
size="small" size="small"
disabled="true" :disabled="true"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
......
...@@ -109,6 +109,7 @@ export function request(config) { ...@@ -109,6 +109,7 @@ export function request(config) {
const passMsgOld = '/web/auth/changePassOld'; const passMsgOld = '/web/auth/changePassOld';
const getCam = '/web/auth/getCam'; const getCam = '/web/auth/getCam';
const registerCode = '/web/code/registerCode'; const registerCode = '/web/code/registerCode';
const registerEmailCode = 'web/code/registerEmailCode';
const passwordEmailCode = 'web/code/passwordEmailCode'; const passwordEmailCode = 'web/code/passwordEmailCode';
const passwordCode = '/web/code/passwordCode'; const passwordCode = '/web/code/passwordCode';
const changePassCode = '/web/auth/changePassCode'; const changePassCode = '/web/auth/changePassCode';
...@@ -121,6 +122,7 @@ export function request(config) { ...@@ -121,6 +122,7 @@ export function request(config) {
config.url.indexOf(passMsgOld) != -1 || config.url.indexOf(passMsgOld) != -1 ||
config.url.indexOf(getCam) != -1 || config.url.indexOf(getCam) != -1 ||
config.url.indexOf(registerCode) != -1 || config.url.indexOf(registerCode) != -1 ||
config.url.indexOf(registerEmailCode) != -1 ||
config.url.indexOf(passwordEmailCode) != -1 || config.url.indexOf(passwordEmailCode) != -1 ||
config.url.indexOf(changePassCode) != -1 || config.url.indexOf(changePassCode) != -1 ||
config.url.indexOf(passwordCode) != -1 || config.url.indexOf(passwordCode) != -1 ||
......
...@@ -5,7 +5,16 @@ import { ...@@ -5,7 +5,16 @@ import {
} from './network' } from './network'
import store from '@/store' import store from '@/store'
// 通过邮箱验证码找回密码 // 通过邮箱验证码注册
export function registerEmailCode(data) {
data['identity'] = store.state.indexIdentity;
return request({
method: 'post',
url: 'web/code/registerEmailCode',
params: data
})
}
// 通过邮箱验证码找回密码(忘记密码)
export function passwordEmailCode(data) { export function passwordEmailCode(data) {
data['identity'] = store.state.indexIdentity; data['identity'] = store.state.indexIdentity;
return request({ return request({
......
...@@ -79,6 +79,7 @@ export default { ...@@ -79,6 +79,7 @@ export default {
isNexts: "", isNexts: "",
signBackStatus: "", signBackStatus: "",
invitation_code: "",//邀请码 invitation_code: "",//邀请码
}; };
}, },
created() { created() {
...@@ -89,6 +90,7 @@ export default { ...@@ -89,6 +90,7 @@ export default {
}, },
watch: { watch: {
$route: { $route: {
handler(val) { handler(val) {
// console.log(val, "routeval"); // console.log(val, "routeval");
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<div class="fr" @click="register()">还没有账号?立即注册</div> <div class="fr" @click="register()">还没有账号?立即注册</div>
<div class="fl" @click="forgetPwd()">忘记密码?</div> <div class="fl" @click="forgetPwd()">忘记密码?</div>
</div> </div>
<div class="fc">忘记密码请联系管理员邮箱:ydhdservice@163.com</div> <!-- <div class="fc">忘记密码请联系管理员邮箱:ydhdservice@163.com</div> -->
</div> </div>
</el-form> </el-form>
</div> </div>
......
...@@ -44,6 +44,22 @@ ...@@ -44,6 +44,22 @@
<span v-show="!show" class="count">{{ count }} s</span> <span v-show="!show" class="count">{{ count }} s</span>
</div> </div>
</el-form-item> --> </el-form-item> -->
<el-form-item prop="code">
<img class="img_l" src="@/assets/img/reset/code.png" alt="" />
<el-input
v-model="registerForm.code"
placeholder="请输入邮箱注册验证码"
maxlength="20"
autocomplete="off"
></el-input>
<!-- 短信验证码 -->
<div class="phoneCode">
<span class="code" v-show="showCode" @click="getCode"
>获取邮箱验证码</span
>
<span v-show="!showCode" class="count">{{ count }} s</span>
</div>
</el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<img class="img_l" src="@/assets/img/reset/password.png" alt="" /> <img class="img_l" src="@/assets/img/reset/password.png" alt="" />
<el-input <el-input
...@@ -93,9 +109,14 @@ ...@@ -93,9 +109,14 @@
/* eslint-disable */ /* eslint-disable */
// 请求接口 // 请求接口
import { registerCode, setAccountInfo } from "r/index/register"; import {
registerCode,
setAccountInfo,
registerEmailCode,
} from "r/index/register";
import { mobileCheck, checkStrong } from "@/common/utils.js"; import { mobileCheck, checkStrong } from "@/common/utils.js";
import validator from "common/validator"; import validator from "common/validator";
import { intervalTime } from "store/time";
export default { export default {
name: "index-register", name: "index-register",
...@@ -111,14 +132,15 @@ export default { ...@@ -111,14 +132,15 @@ export default {
return { return {
inputType: "", inputType: "",
// 手机验证短信 // 手机验证短信
// show: true, showCode: true,
// count: "", count: "",
// timer: null, timer: null,
codeTime: "", //手机验证码倒计时时间
isShowPwd: true, // 控制密码显示隐藏 isShowPwd: true, // 控制密码显示隐藏
registerForm: { registerForm: {
phone: "", phone: "",
// code: "",
email: "", email: "",
code: "",
password: "", password: "",
rq_password: "", rq_password: "",
}, },
...@@ -147,10 +169,10 @@ export default { ...@@ -147,10 +169,10 @@ export default {
}, },
], ],
// 对验证码进行校验 // 对验证码进行校验
// code: [ code: [
// { required: true, message: "请输入验证码", trigger: "blur" }, { required: true, message: "请输入验证码", trigger: "blur" },
// { min: 6, max: 20, message: "请输入正确的验证码", trigger: "blur" }, { min: 6, max: 20, message: "请输入正确的验证码", trigger: "blur" },
// ], ],
// 对密码进行校验 // 对密码进行校验
password: [ password: [
{ {
...@@ -196,10 +218,11 @@ export default { ...@@ -196,10 +218,11 @@ export default {
}; };
}, },
created() { created() {
const endTime = window.localStorage.getItem("register_code_time"); const code = this.$store.state.indexIdentity;
const phone = window.localStorage.getItem("register_code_phone"); const endTime = window.localStorage.getItem("register_code_time" + code);
if (endTime && Number(endTime) > new Date().getTime()) { if (endTime && Number(endTime) > new Date().getTime()) {
this.registerForm.phone = phone; this.resetForm.phone = phone;
this.intervalHandle(new Date(), Number(endTime)); this.intervalHandle(new Date(), Number(endTime));
} }
}, },
...@@ -214,50 +237,51 @@ export default { ...@@ -214,50 +237,51 @@ export default {
this.isShowPwd = !this.isShowPwd; this.isShowPwd = !this.isShowPwd;
}, },
// 定时器倒计时 // 定时器倒计时
// intervalHandle(startTime, endTime) { intervalHandle(startTime, endTime) {
// // 时间差 // 时间差
// const timeLag = intervalTime(startTime, endTime); const timeLag = intervalTime(startTime, endTime);
// console.log(timeLag); console.log(timeLag);
// if (!this.timer) { if (!this.timer) {
// this.count = timeLag; this.count = timeLag - 1;
// this.show = false; this.showCode = false;
// this.timer = setInterval(() => { this.timer = setInterval(() => {
// if (this.count > 0 && this.count <= timeLag) { if (this.count > 0 && this.count <= timeLag) {
// this.count--; this.count--;
// } else { } else {
// this.show = true; this.showCode = true;
// clearInterval(this.timer); clearInterval(this.timer);
// this.timer = null; this.timer = null;
// } }
// }, 1000); }, 1000);
// } }
// }, },
// 获取手机验证短信 // 获取手机验证短信
// getCode() { getCode() {
// if (!this.registerForm.phone) { if (!this.registerForm.email) {
// return this.$message.error("请输入手机号"); return this.$message.error("请输入邮箱");
// } }
// // 接口获得验证码 // if (!this.codeTime) {
// registerCode({ // return this.$message.error("您已经获取验证码,请去邮箱中进行查看");
// phone: this.registerForm.phone, // }
// }).then((res) => { // 接口获得验证码
// console.log(res); registerEmailCode({
// if (res.data.code != 200) { email: this.registerForm.email,
// return this.$message.error(res.data.message); }).then((res) => {
// } console.log(res, "passwordCode");
// this.$message.success(res.data.message); if (res.data.code != 200) {
return this.$message.error(res.data.message);
// window.localStorage.setItem( }
// "register_code_time", this.$message.success(res.data.message);
// res.data.data.now * 1000 this.codeTime = res.data.data.now * 1000;
// ); // console.log(this.codeTime)
// window.localStorage.setItem( let code = this.$store.state.indexIdentity;
// "register_code_phone", window.localStorage.setItem(
// this.registerForm.phone "register_code_time" + code,
// ); res.data.data.now * 1000
// this.intervalHandle(new Date(), res.data.data.now * 1000); );
// }); this.intervalHandle(new Date(), res.data.data.now * 1000);
// }, });
},
// 表单验证 // 表单验证
submitForm() { submitForm() {
...@@ -266,7 +290,7 @@ export default { ...@@ -266,7 +290,7 @@ export default {
setAccountInfo({ setAccountInfo({
phone: this.registerForm.phone, phone: this.registerForm.phone,
email: this.registerForm.email, email: this.registerForm.email,
// code: this.registerForm.code, code: this.registerForm.code,
password: this.registerForm.password, password: this.registerForm.password,
rq_password: this.registerForm.rq_password, rq_password: this.registerForm.rq_password,
}).then((res) => { }).then((res) => {
......
...@@ -129,8 +129,8 @@ export default { ...@@ -129,8 +129,8 @@ export default {
showCode: true, showCode: true,
count: "", count: "",
timer: null, timer: null,
isShowPwd: true, // 控制密码显示隐藏
codeTime: "", //手机验证码倒计时时间 codeTime: "", //手机验证码倒计时时间
isShowPwd: true, // 控制密码显示隐藏
resetForm: { resetForm: {
phone: "", phone: "",
email: "", email: "",
...@@ -163,10 +163,10 @@ export default { ...@@ -163,10 +163,10 @@ export default {
}, },
], ],
// 对验证码进行校验 // 对验证码进行校验
// code: [ code: [
// { required: true, message: "请输入验证码", trigger: "blur" }, { required: true, message: "请输入验证码", trigger: "blur" },
// { min: 6, max: 20, message: "请输入正确的验证码", trigger: "blur" }, { min: 6, max: 20, message: "请输入正确的验证码", trigger: "blur" },
// ], ],
// 对密码进行校验 // 对密码进行校验
password: [ password: [
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment