|
@@ -73,15 +73,21 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
- <list-info :isShow="isShow" :isShow2="isShow2" @close1="isShow2 = false" ref="public"></list-info>
|
|
|
|
|
|
|
+ <register-info
|
|
|
|
|
+ :isShow="isShow"
|
|
|
|
|
+ :isShow2="isShow2"
|
|
|
|
|
+ @init="init"
|
|
|
|
|
+ @close1="isShow2 = false"
|
|
|
|
|
+ @refreash="refreash"
|
|
|
|
|
+ ></register-info>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
import phone from '../mixins/phone';
|
|
import phone from '../mixins/phone';
|
|
|
-import listInfo from '../components/listInfo.vue';
|
|
|
|
|
|
|
+import RegisterInfo from './RegisterInfo.vue';
|
|
|
export default {
|
|
export default {
|
|
|
mixins: [phone],
|
|
mixins: [phone],
|
|
|
- components: { listInfo },
|
|
|
|
|
|
|
+ components: { RegisterInfo },
|
|
|
props: {
|
|
props: {
|
|
|
Show: {
|
|
Show: {
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
@@ -94,25 +100,9 @@ export default {
|
|
|
isShow: false,
|
|
isShow: false,
|
|
|
isShow2: false,
|
|
isShow2: false,
|
|
|
phoneLogin: false,
|
|
phoneLogin: false,
|
|
|
- rules: {
|
|
|
|
|
- password: [{ min: 8, max: 16, message: '密码长度在 8 到 16 个字符', trigger: 'blur' }],
|
|
|
|
|
- password2: [
|
|
|
|
|
- {
|
|
|
|
|
- validator: (rule, value, callback) => {
|
|
|
|
|
- if (value !== this.form.password) {
|
|
|
|
|
- callback(new Error('两次密码输入不一致'));
|
|
|
|
|
- } else {
|
|
|
|
|
- callback();
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- trigger: 'blur'
|
|
|
|
|
- },
|
|
|
|
|
- { required: true, message: '请再次输入密码', trigger: 'blur' }
|
|
|
|
|
- ]
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ rules: {},
|
|
|
form: {},
|
|
form: {},
|
|
|
- time: 0,
|
|
|
|
|
- checked: false
|
|
|
|
|
|
|
+ time: 0
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -130,73 +120,86 @@ export default {
|
|
|
this.isShow = true;
|
|
this.isShow = true;
|
|
|
this.isShow2 = true;
|
|
this.isShow2 = true;
|
|
|
},
|
|
},
|
|
|
|
|
+ refreash() {
|
|
|
|
|
+ this.Show = false;
|
|
|
|
|
+ this.isShow = false;
|
|
|
|
|
+ },
|
|
|
|
|
+ init() {
|
|
|
|
|
+ this.isShow = false;
|
|
|
|
|
+ this.Show = true;
|
|
|
|
|
+ this.phoneLogin = false;
|
|
|
|
|
+ },
|
|
|
|
|
+ handleClose() {
|
|
|
|
|
+ this.Show = false;
|
|
|
|
|
+ this.phoneLogin = false;
|
|
|
|
|
+ },
|
|
|
// 忘记密码
|
|
// 忘记密码
|
|
|
passwordFn() {
|
|
passwordFn() {
|
|
|
this.Show = false;
|
|
this.Show = false;
|
|
|
- // this.isShow = true;
|
|
|
|
|
- // this.isShow2 = false;
|
|
|
|
|
|
|
+ this.isShow = true;
|
|
|
|
|
+ this.isShow2 = false;
|
|
|
},
|
|
},
|
|
|
// 注册
|
|
// 注册
|
|
|
- doRegister() {
|
|
|
|
|
- this.$http;
|
|
|
|
|
- this.verifyMsg(this.form.phone, this.form.code).then(() => {
|
|
|
|
|
- return (
|
|
|
|
|
- this.$http
|
|
|
|
|
- .post('/auth/phoneRegister', {
|
|
|
|
|
- phone: this.form.phone,
|
|
|
|
|
- password: this.form.password,
|
|
|
|
|
- code: this.form.code
|
|
|
|
|
- })
|
|
|
|
|
- // })
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- console.log(res);
|
|
|
|
|
- localStorage.setItem('webToken', res);
|
|
|
|
|
- return this.$store.dispatch('getUserInfo');
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- this.$message.success('注册成功');
|
|
|
|
|
- // this.flag = false;
|
|
|
|
|
- this.Show = false;
|
|
|
|
|
- })
|
|
|
|
|
- .catch(e => {
|
|
|
|
|
- if (e) {
|
|
|
|
|
- this.$message.error(e.error);
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- );
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // doRegister() {
|
|
|
|
|
+ // this.$http;
|
|
|
|
|
+ // this.verifyMsg(this.form.phone, this.form.code).then(() => {
|
|
|
|
|
+ // return (
|
|
|
|
|
+ // this.$http
|
|
|
|
|
+ // .post('/auth/phoneRegister', {
|
|
|
|
|
+ // phone: this.form.phone,
|
|
|
|
|
+ // password: this.form.password,
|
|
|
|
|
+ // code: this.form.code
|
|
|
|
|
+ // })
|
|
|
|
|
+ // // })
|
|
|
|
|
+ // .then(res => {
|
|
|
|
|
+ // console.log(res);
|
|
|
|
|
+ // localStorage.setItem('webToken', res);
|
|
|
|
|
+ // return this.$store.dispatch('getUserInfo');
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .then(() => {
|
|
|
|
|
+ // this.$message.success('注册成功');
|
|
|
|
|
+ // // this.flag = false;
|
|
|
|
|
+ // this.Show = false;
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .catch(e => {
|
|
|
|
|
+ // if (e) {
|
|
|
|
|
+ // this.$message.error(e.error);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // })
|
|
|
|
|
+ // );
|
|
|
|
|
+ // });
|
|
|
|
|
+ // },
|
|
|
// 验证码
|
|
// 验证码
|
|
|
send() {
|
|
send() {
|
|
|
this.sendMsg(this.form.phone);
|
|
this.sendMsg(this.form.phone);
|
|
|
},
|
|
},
|
|
|
// 修改密码
|
|
// 修改密码
|
|
|
- passwordFn2() {
|
|
|
|
|
- this.verifyMsg(this.form.phone, this.form.code)
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- this.$http
|
|
|
|
|
- .post('/auth/forgotPassword', {
|
|
|
|
|
- phone: this.form.phone,
|
|
|
|
|
- password: this.form.password,
|
|
|
|
|
- code: this.form.code
|
|
|
|
|
- })
|
|
|
|
|
- // })
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- this.$toast.success('修改成功');
|
|
|
|
|
- this.Show = false;
|
|
|
|
|
- })
|
|
|
|
|
- .catch(e => {
|
|
|
|
|
- if (e) {
|
|
|
|
|
- this.$message.error(e.error);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- })
|
|
|
|
|
- .catch(e => {
|
|
|
|
|
- if (e) {
|
|
|
|
|
- this.$message.error(e.error);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // passwordFn2() {
|
|
|
|
|
+ // this.verifyMsg(this.form.phone, this.form.code)
|
|
|
|
|
+ // .then(() => {
|
|
|
|
|
+ // this.$http
|
|
|
|
|
+ // .post('/auth/forgotPassword', {
|
|
|
|
|
+ // phone: this.form.phone,
|
|
|
|
|
+ // password: this.form.password,
|
|
|
|
|
+ // code: this.form.code
|
|
|
|
|
+ // })
|
|
|
|
|
+ // // })
|
|
|
|
|
+ // .then(() => {
|
|
|
|
|
+ // this.$toast.success('修改成功');
|
|
|
|
|
+ // this.Show = false;
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .catch(e => {
|
|
|
|
|
+ // if (e) {
|
|
|
|
|
+ // this.$message.error(e.error);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .catch(e => {
|
|
|
|
|
+ // if (e) {
|
|
|
|
|
+ // this.$message.error(e.error);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // },
|
|
|
// 密码登录
|
|
// 密码登录
|
|
|
check() {
|
|
check() {
|
|
|
this.$http
|
|
this.$http
|