Commit 1c0f3c03 authored by wuwangwolihui's avatar wuwangwolihui

Merge remote-tracking branch 'origin/yingdi2.0' into yingdi2.0

parents 9eda2c8c 6e42c0ed
/* eslint-disable */
import {
request
} from './network'
// 通过邮箱验证码注册
export function registerEmailCode(data) {
return request({
method: 'post',
url: 'web/code/registerEmailCode',
params: data
})
}
// 通过邮箱验证码找回密码(忘记密码)
export function passwordEmailCode(data) {
return request({
method: 'post',
url: 'web/code/passwordEmailCode',
params: data
})
}
// 发送注册时候验证码
export function registerCode(data) {
return request({
method: 'post',
url: '/web/code/registerCode',
params: data
})
}
export function passwordCode(data) {
return request({
method: 'post',
url: '/web/code/passwordCode',
params: data
})
}
// 填写注册信息
export function setAccountInfo(data) {
return request({
method: 'post',
url: '/web/register/setAccountInfo',
data
})
}
// 获取注册信息
export function getAccountInfo(data) {
return request({
method: 'post',
url: '/web/register/getAccountInfo',
data
})
}
......@@ -15,7 +15,7 @@ export default [{
}
},
{
path: '/reset',
path: '/baseReset',
name: 'base-reset',
component: () => import(/* webpackChunkName: "reset" */ 'v/base/login/Reset.vue'),
meta: {
......
......@@ -204,7 +204,9 @@ router.beforeEach((to, from, next) => {
toLogin = "/login",
toBaseLogin = "/baseLogin",
toRegister = "/register",
toBaseRegister = "/baseRegister",
toReset = "/reset",
toBaseReset = "/baseReset",
toHome = "/home",
toActive = "/active";
let toMyInfo;
......@@ -225,7 +227,7 @@ router.beforeEach((to, from, next) => {
// }
// });
return next();
} else if (to.path == toBaseLogin || to.path == toMyInfo || to.path == toHome || to.path == toActive || to.path.indexOf(toActive) != -1) {
} else if (to.path == toBaseLogin ||to.path == toBaseRegister ||to.path == toBaseReset || to.path == toMyInfo || to.path == toHome || to.path == toActive || to.path.indexOf(toActive) != -1) {
return next();
} else if (to.name == "recruit") {
code = to.params.code;
......
<template>
<div class="login-index">
<Header></Header>
<div class="big-right">
<div class="info-box">
<router-view />
<router-view/>
</div>
</div>
</div>
</template>
<script>
/* eslint-disable */
import Cookie from "js-cookie"
/* eslint-disable */
import Header from "@/components/base/Header.vue";
export default {
export default {
name: "loginBase",
data() {
return {
};
return {};
},
created() {
this.$emit("getStatus", false);
components: {
Header,
},
methods: {
toHome() {
let code = this.$store.state.indexIdentity;
this.$router.push("/"+code);
}
created() {
},
};
methods: {},
};
</script>
<style scoped lang="scss">
.login-index {
<style lang="scss" scoped>
@media (min-width: 1024px) {
.login-index .big-right .info-box {
width: 32%!important;
top: 60%!important;
}
}
.login-index {
position: relative;
min-width: 1104px;
background: #f8f8f8;
display: flex;
flex-flow: row;
min-height: 100%;
.big-img {
width: (500/1920 * 100%);
min-width: 350px;
min-height: 100%;
img {
width: 100%;
min-height: 100%;
}
}
.big-right {
flex: 1;
position: relative;
height: calc(100% - 80px);
.info-box {
width: 520px;
height: auto;
......@@ -59,5 +54,5 @@ export default {
transform: translate(-50%, -50%);
}
}
}
}
</style>
This diff is collapsed.
......@@ -16,26 +16,26 @@
v-model="registerForm.phone"
placeholder="请输入手机号"
maxlength="11"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item prop="email">
<!-- <el-form-item prop="email">
<img class="img_l" src="@/assets/img/reset/username.png" alt="" />
<el-input
v-model="registerForm.email"
placeholder="请输入邮箱"
autocomplete="off"
></el-input>
</el-form-item>
<!-- <el-form-item prop="code">
</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> -->
></el-input>
<!-- 短信验证码 -->
<!-- <div class="phoneCode">
<span class="code" v-show="show" @click="getCode"
......@@ -44,18 +44,18 @@
<span v-show="!show" class="count">{{ count }} s</span>
</div>
</el-form-item> -->
<el-form-item prop="code">
<!-- <el-form-item prop="code">
<img class="img_l" src="@/assets/img/reset/code.png" alt="" />
<el-input
v-model="registerForm.code"
placeholder="请输入邮箱注册验证码"
maxlength="6"
autocomplete="off"
></el-input>
></el-input> -->
<!-- 短信验证码 -->
<div class="phoneCode">
<span class="code" v-show="showCode" @click="getCode"
>获取邮箱验证码</span
>获取验证码</span
>
<span v-show="!showCode" class="count">{{ count }} s</span>
</div>
......@@ -89,7 +89,7 @@
v-model="registerForm.rq_password"
placeholder="请再次输入登录密码"
maxlength="20"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item style="margin: 40px 0 0 0"></el-form-item>
......@@ -106,20 +106,18 @@
</template>
<script>
/* eslint-disable */
// 请求接口
import {
/* eslint-disable */
import {
registerCode,
setAccountInfo,
registerEmailCode,
} from "r/index/register";
import { mobileCheck, checkStrong } from "@/common/utils.js";
import validator from "common/validator";
import { intervalTime } from "store/time";
} from "r/base/register";
import { mobileCheck, checkStrong } from "@/common/utils.js";
import validator from "common/validator";
import { intervalTime } from "store/time";
export default {
name: "index-register",
export default {
name: "base-register",
data() {
const pwdCheck = async (rule, value, callback) => {
if (value !== this.registerForm.password) {
......@@ -139,7 +137,7 @@ export default {
isShowPwd: true, // 控制密码显示隐藏
registerForm: {
phone: "",
email: "",
// email: "",
code: "",
password: "",
rq_password: "",
......@@ -161,13 +159,13 @@ export default {
},
],
// 对邮箱验证
email: [
{ required: true, message: "请输入邮箱", trigger: "blur" },
{
validator: validator.validateEmail,
trigger: "blur",
},
],
// email: [
// { required: true, message: "请输入邮箱", trigger: "blur" },
// {
// validator: validator.validateEmail,
// trigger: "blur",
// },
// ],
// 对验证码进行校验
code: [
{ required: true, message: "请输入验证码", trigger: "blur" },
......@@ -218,19 +216,17 @@ export default {
};
},
created() {
const code = this.$store.state.indexIdentity;
const endTime = window.localStorage.getItem("register_code_time" + code);
const endTime = window.localStorage.getItem("register_code_time" );
if (endTime && Number(endTime) > new Date().getTime()) {
this.resetForm.phone = phone;
this.intervalHandle(new Date(), Number(endTime));
}
this.commonApi(30)
},
methods: {
// 去注册
toLogin() {
let code = this.$store.state.indexIdentity;
this.$router.push("/login?code=" + code);
this.$router.push("/baseLogin");
},
// 改变密码显示状态
changePwdStatus() {
......@@ -257,16 +253,15 @@ export default {
},
// 获取手机验证短信
getCode() {
if (!this.registerForm.email) {
if (!this.registerForm.phone) {
return this.$message.error("请输入邮箱");
}
// if (!this.codeTime) {
// return this.$message.error("您已经获取验证码,请去邮箱中进行查看");
// }
// 接口获得验证码
registerEmailCode({
email: this.registerForm.email,
registerCode({
phone: this.registerForm.phone,
}).then((res) => {
console.log(res, "passwordCode");
if (res.data.code != 200) {
......@@ -275,9 +270,8 @@ export default {
this.$message.success(res.data.message);
this.codeTime = res.data.data.now * 1000;
// console.log(this.codeTime)
let code = this.$store.state.indexIdentity;
window.localStorage.setItem(
"register_code_time" + code,
"register_code_time" ,
res.data.data.now * 1000
);
this.intervalHandle(new Date(), res.data.data.now * 1000);
......@@ -290,7 +284,7 @@ export default {
if (!valid) return;
setAccountInfo({
phone: this.registerForm.phone,
email: this.registerForm.email,
// email: this.registerForm.email,
code: this.registerForm.code,
password: this.registerForm.password,
rq_password: this.registerForm.rq_password,
......@@ -300,32 +294,29 @@ export default {
return this.$message.error(res.data.message);
}
// this.$message.success(res.data.message);
let code = this.$store.state.indexIdentity;
// token存储
window.localStorage.setItem("index-token" + code, res.data.token);
window.localStorage.setItem("phone" + code, this.registerForm.phone);
window.localStorage.setItem("email" + code, this.registerForm.email);//邮箱
window.localStorage.setItem("index-token" , res.data.token);
window.localStorage.setItem("phone" , this.registerForm.phone);
// window.localStorage.setItem("email" + code, this.registerForm.email);
// 报名信息
window.localStorage.setItem("camp_name" + code, res.data.cam.name);
window.localStorage.setItem("camp_name" , res.data.cam.name);
//获取主题色
window.localStorage.setItem(
"system_color" + code,
"system_color" ,
res.data.cam.system_color
);
// 跳转到报名
this.$router.push("/signUp/examInfo?code=" + code);
this.$router.replace("/signUpList" );
});
});
},
},
};
};
</script>
<style scoped lang="scss">
// 注册输入
.container {
// 注册输入
.container {
background: #ffffff;
box-shadow: 0px 1px 18px 0px rgba(0, 0, 0, 0.06);
border-radius: 8px;
......@@ -334,8 +325,8 @@ export default {
overflow: hidden;
.title {
margin: 19px 0 6px 0;
width: 132px;
// margin: 19px 0 6px 0;
// width: 132px;
height: 20px;
font-size: 22px;
font-weight: 500;
......@@ -343,12 +334,12 @@ export default {
line-height: 20px;
}
.line {
width: 103px;
height: 3px;
background: var(--color);
border-radius: 2px;
}
// .line {
// width: 103px;
// height: 3px;
// background: var(--color);
// border-radius: 2px;
// }
::v-deep .el-form {
margin-top: 60px;
......@@ -449,23 +440,23 @@ export default {
}
}
}
}
}
@media screen and (max-width: 1601px) {
@media screen and (max-width: 1601px) {
.container {
right: 18%;
}
}
}
@media screen and (max-width: 1501px) {
@media screen and (max-width: 1501px) {
.container {
right: 16%;
}
}
}
@media screen and (max-width: 1401px) {
@media screen and (max-width: 1401px) {
.container {
right: 14%;
}
}
}
</style>
......@@ -16,25 +16,23 @@
v-model="resetForm.phone"
placeholder="请输入手机号"
maxlength="11"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item prop="email">
<!-- <el-form-item prop="email">
<img class="img_l" src="@/assets/img/reset/username.png" alt="" />
<el-input
v-model="resetForm.email"
placeholder="请输入邮箱"
autocomplete="off"
></el-input>
</el-form-item>
<!-- <el-form-item prop="code">
</el-form-item> -->
<el-form-item prop="code">
<img class="img_l" src="@/assets/img/reset/code.png" alt="" />
<el-input
v-model="resetForm.code"
placeholder="请输入短信验证码"
maxlength="20"
autocomplete="off"
></el-input> -->
></el-input>
<!-- 短信验证码 -->
<!-- <div class="phoneCode">
<span class="code" v-show="showCode" @click="getCode"
......@@ -43,18 +41,18 @@
<span v-show="!showCode" class="count">{{ count }} s</span>
</div>
</el-form-item> -->
<el-form-item prop="code">
<!-- <el-form-item prop="code">
<img class="img_l" src="@/assets/img/reset/code.png" alt="" />
<el-input
v-model="resetForm.code"
placeholder="请输入邮箱验证码"
maxlength="6"
autocomplete="off"
></el-input>
></el-input> -->
<!-- 短信验证码 -->
<div class="phoneCode">
<span class="code" v-show="showCode" @click="getCode"
>获取邮箱验证码</span
>获取验证码</span
>
<span v-show="!showCode" class="count">{{ count }} s</span>
</div>
......@@ -88,7 +86,6 @@
v-model="resetForm.rq_password"
placeholder="请再次输入新的登录密码"
maxlength="20"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item style="margin: 40px 0 0 0"></el-form-item>
......@@ -105,16 +102,16 @@
</template>
<script>
/* eslint-disable */
// 请求接口
import { passwordEmailCode } from "r/index/register";
import { changePassCode } from "r/index/login";
import { mobileCheck } from "@/common/utils.js";
import { intervalTime } from "store/time";
import validator from "common/validator";
/* eslint-disable */
// 请求接口
import { passwordCode } from "r/base/register";
import { changePassCode } from "r/base/login";
import { mobileCheck } from "@/common/utils.js";
import { intervalTime } from "store/time";
import validator from "common/validator";
export default {
name: "index-reset",
export default {
name: "base-reset",
data() {
const pwdCheck = async (rule, value, callback) => {
if (value !== this.resetForm.password) {
......@@ -132,7 +129,7 @@ export default {
isShowPwd: true, // 控制密码显示隐藏
resetForm: {
phone: "",
email: "",
// email: "",
code: "",
password: "",
rq_password: "",
......@@ -154,13 +151,13 @@ export default {
},
],
// 对邮箱验证
email: [
{ required: true, message: "请输入邮箱", trigger: "blur" },
{
validator: validator.validateEmail,
trigger: "blur",
},
],
// email: [
// { required: true, message: "请输入邮箱", trigger: "blur" },
// {
// validator: validator.validateEmail,
// trigger: "blur",
// },
// ],
// 对验证码进行校验
code: [
{ required: true, message: "请输入验证码", trigger: "blur" },
......@@ -211,9 +208,8 @@ export default {
};
},
created() {
const code = this.$store.state.indexIdentity;
const endTime = window.localStorage.getItem("restet_code_time" + code);
const phone = window.localStorage.getItem("restet_code_phone" + code);
const endTime = window.localStorage.getItem("restet_code_time" );
const phone = window.localStorage.getItem("restet_code_phone" );
if (endTime && Number(endTime) > new Date().getTime()) {
this.resetForm.phone = phone;
this.intervalHandle(new Date(), Number(endTime));
......@@ -222,8 +218,7 @@ export default {
methods: {
// 去注册
toLogin() {
let code = this.$store.state.indexIdentity;
this.$router.push("/login?code=" + code);
this.$router.push("/baseLogin" );
},
// 改变密码显示状态
changePwdStatus() {
......@@ -250,16 +245,16 @@ export default {
},
// 获取手机验证短信
getCode() {
if (!this.resetForm.email) {
return this.$message.error("请输入邮箱");
if (!this.resetForm.phone) {
return this.$message.error("请输入手机号");
}
// if (!this.codeTime) {
// return this.$message.error("您已经获取验证码,请去邮箱中进行查看");
// }
// 接口获得验证码
passwordEmailCode({
passwordCode({
phone: this.resetForm.phone,
email: this.resetForm.email,
// email: this.resetForm.email,
}).then((res) => {
console.log(res, "passwordCode");
if (res.data.code != 200) {
......@@ -268,9 +263,8 @@ export default {
this.$message.success(res.data.message);
this.codeTime = res.data.data.now * 1000;
// console.log(this.codeTime)
let code = this.$store.state.indexIdentity;
window.localStorage.setItem(
"restet_code_time" + code,
"restet_code_time" ,
res.data.data.now * 1000
);
this.intervalHandle(new Date(), res.data.data.now * 1000);
......@@ -294,23 +288,22 @@ export default {
}
this.$message.success(res.data.message);
// token存储
let code = this.$store.state.indexIdentity;
// window.localStorage.setItem("index-token" + code, res.token);
window.localStorage.setItem(
"restet_code_phone" + code,
"restet_code_phone" ,
this.resetForm.phone
);
this.$router.push("/login?code=" + code);
this.$router.replace("/baseLogin");
});
});
},
},
};
};
</script>
<style scoped lang="scss">
// 注册输入
.container {
// 注册输入
.container {
background: #ffffff;
box-shadow: 0px 1px 18px 0px rgba(0, 0, 0, 0.06);
border-radius: 8px;
......@@ -319,21 +312,22 @@ export default {
overflow: hidden;
.title {
margin: 19px 0 6px 0;
width: 132px;
// margin: 19px 0 6px 0;
// width: 132px;
height: 20px;
font-size: 22px;
font-weight: 500;
color: var(--color);
line-height: 20px;
text-align: center;
}
.line {
width: 83px;
height: 3px;
background: var(--color);
border-radius: 2px;
}
// .line {
// width: 83px;
// height: 3px;
// background: var(--color);
// border-radius: 2px;
// }
::v-deep .el-form {
margin-top: 60px;
......@@ -434,23 +428,23 @@ export default {
}
}
}
}
}
@media screen and (max-width: 1601px) {
@media screen and (max-width: 1601px) {
.container {
right: 18%;
}
}
}
@media screen and (max-width: 1501px) {
@media screen and (max-width: 1501px) {
.container {
right: 16%;
}
}
}
@media screen and (max-width: 1401px) {
@media screen and (max-width: 1401px) {
.container {
right: 14%;
}
}
}
</style>
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