|
@@ -18,17 +18,22 @@
|
|
|
}"
|
|
}"
|
|
|
>
|
|
>
|
|
|
<span class="el-icon-mobile-phone"></span>
|
|
<span class="el-icon-mobile-phone"></span>
|
|
|
- <el-input style="width: 300px" v-model="form.phone" placeholder="请输入手机号"></el-input>
|
|
|
|
|
|
|
+ <el-input style="width: 300px;" v-model="form.phone" placeholder="请输入手机号"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<div>
|
|
<div>
|
|
|
<el-form-item prop="code" :rules="{ required: true, message: '请输入', trigger: 'blur' }">
|
|
<el-form-item prop="code" :rules="{ required: true, message: '请输入', trigger: 'blur' }">
|
|
|
<span class="icon">
|
|
<span class="icon">
|
|
|
<img src="../assets/img/login_icon_yanzhengma@3x (2).png" alt="" />
|
|
<img src="../assets/img/login_icon_yanzhengma@3x (2).png" alt="" />
|
|
|
</span>
|
|
</span>
|
|
|
- <el-input style="width: 300px" v-model="form.code" placeholder="请输入短信验证码">
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ style="width: 300px;"
|
|
|
|
|
+ maxlength="4"
|
|
|
|
|
+ v-model="form.code"
|
|
|
|
|
+ placeholder="请输入短信验证码"
|
|
|
|
|
+ >
|
|
|
<span
|
|
<span
|
|
|
@click="send"
|
|
@click="send"
|
|
|
- style="color: #ff4f50; cursor: pointer; font-size: 13px"
|
|
|
|
|
|
|
+ style="color: #ff4f50; cursor: pointer; font-size: 13px;"
|
|
|
slot="suffix"
|
|
slot="suffix"
|
|
|
>{{ time === 0 ? '发送验证码' : `重新发送${time}s` }}</span
|
|
>{{ time === 0 ? '发送验证码' : `重新发送${time}s` }}</span
|
|
|
>
|
|
>
|
|
@@ -38,7 +43,7 @@
|
|
|
<el-form-item prop="password">
|
|
<el-form-item prop="password">
|
|
|
<span class="el-icon-unlock"></span>
|
|
<span class="el-icon-unlock"></span>
|
|
|
<el-input
|
|
<el-input
|
|
|
- style="width: 300px"
|
|
|
|
|
|
|
+ style="width: 300px;"
|
|
|
v-model="form.password"
|
|
v-model="form.password"
|
|
|
type="password"
|
|
type="password"
|
|
|
autocomplete="off"
|
|
autocomplete="off"
|
|
@@ -48,7 +53,7 @@
|
|
|
<el-form-item prop="password2">
|
|
<el-form-item prop="password2">
|
|
|
<span class="el-icon-unlock"></span>
|
|
<span class="el-icon-unlock"></span>
|
|
|
<el-input
|
|
<el-input
|
|
|
- style="width: 300px"
|
|
|
|
|
|
|
+ style="width: 300px;"
|
|
|
v-model="form.password2"
|
|
v-model="form.password2"
|
|
|
type="password"
|
|
type="password"
|
|
|
autocomplete="off"
|
|
autocomplete="off"
|
|
@@ -58,18 +63,18 @@
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<template>
|
|
<template>
|
|
|
<el-checkbox v-model="checked" v-if="isShow2">
|
|
<el-checkbox v-model="checked" v-if="isShow2">
|
|
|
- <el-link style="margin-bottom: 2px">点击同意注册协议</el-link>
|
|
|
|
|
|
|
+ <el-link style="margin-bottom: 2px;">点击同意注册协议</el-link>
|
|
|
</el-checkbox>
|
|
</el-checkbox>
|
|
|
</template>
|
|
</template>
|
|
|
- <div class="sub-btn" style="width: 300px" v-if="isShow2">
|
|
|
|
|
|
|
+ <div class="sub-btn" style="width: 300px;" v-if="isShow2">
|
|
|
<div class="btn1" @click="doRegister">立即注册</div>
|
|
<div class="btn1" @click="doRegister">立即注册</div>
|
|
|
- <el-button style="background: #f2f3f5; color: #292c33" type="info" class="btn-block" @click="Login"
|
|
|
|
|
|
|
+ <el-button style="background: #f2f3f5; color: #292c33;" type="info" class="btn-block" @click="Login"
|
|
|
>已有账号,立即登录</el-button
|
|
>已有账号,立即登录</el-button
|
|
|
>
|
|
>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="sub-btn" style="width: 300px" v-else>
|
|
|
|
|
|
|
+ <div class="sub-btn" style="width: 300px;" v-else>
|
|
|
<div class="btn1" @click="passwordFn2">重置密码</div>
|
|
<div class="btn1" @click="passwordFn2">重置密码</div>
|
|
|
- <el-button style="background: #f2f3f5; color: #292c33" type="info" class="btn-block" @click="Login"
|
|
|
|
|
|
|
+ <el-button style="background: #f2f3f5; color: #292c33;" type="info" class="btn-block" @click="Login"
|
|
|
>想起密码,立即登录</el-button
|
|
>想起密码,立即登录</el-button
|
|
|
>
|
|
>
|
|
|
</div>
|
|
</div>
|
|
@@ -141,30 +146,21 @@ export default {
|
|
|
this.$message.warning('请点击同意注册协议');
|
|
this.$message.warning('请点击同意注册协议');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- this.verifyMsg(this.form.phone, this.form.code).then(() => {
|
|
|
|
|
- return (
|
|
|
|
|
- this.$http
|
|
|
|
|
- .post('/auth/phoneRegister', {
|
|
|
|
|
- phone: this.form.phone,
|
|
|
|
|
- password: this.form.password
|
|
|
|
|
- })
|
|
|
|
|
- // })
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- console.log(res);
|
|
|
|
|
- localStorage.setItem('webToken', res);
|
|
|
|
|
- return this.$store.dispatch('getUserInfo');
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- this.$message.success('注册成功');
|
|
|
|
|
- this.$emit('init');
|
|
|
|
|
- })
|
|
|
|
|
- .catch(e => {
|
|
|
|
|
- if (e) {
|
|
|
|
|
- this.$message.error(e.error);
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- );
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ return this.$http
|
|
|
|
|
+ .post('/auth/phoneRegister', this.form)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ localStorage.setItem('webToken', res);
|
|
|
|
|
+ return this.$store.dispatch('getUserInfo');
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.$message.success('注册成功');
|
|
|
|
|
+ this.$emit('init');
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(e => {
|
|
|
|
|
+ if (e) {
|
|
|
|
|
+ this.$message.error(e.error);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
// 修改密码
|
|
// 修改密码
|
|
|
passwordFn2() {
|
|
passwordFn2() {
|
|
@@ -297,7 +293,7 @@ export default {
|
|
|
width: 330px;
|
|
width: 330px;
|
|
|
height: 40px;
|
|
height: 40px;
|
|
|
line-height: 40px;
|
|
line-height: 40px;
|
|
|
- background: linear-gradient(135deg, @prim 0%, @warn 100%);
|
|
|
|
|
|
|
+ background: @prim;
|
|
|
border-radius: 4px;
|
|
border-radius: 4px;
|
|
|
font-size: 13px;
|
|
font-size: 13px;
|
|
|
color: #fff;
|
|
color: #fff;
|