忘记密码/统计
This commit is contained in:
@@ -24,3 +24,27 @@ export async function getCaptcha() {
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取手机验证码
|
||||
*/
|
||||
export async function getCode(params) {
|
||||
const res = await request.get('/login/code/', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 忘记密码
|
||||
*/
|
||||
export async function forget(data) {
|
||||
const res = await request.post('/login/forget', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
+30
-69
@@ -50,7 +50,7 @@
|
||||
size="large"
|
||||
:disabled="!!countdownTimer"
|
||||
style="margin-left: 10px"
|
||||
@click="showImgCodeCheck"
|
||||
@click="sendCode"
|
||||
>
|
||||
<span v-if="!countdownTimer">发送验证码</span>
|
||||
<span v-else>已发送 {{ countdownTime }} s</span>
|
||||
@@ -82,32 +82,6 @@
|
||||
<div class="login-copyright">
|
||||
Copyright © 2022 狸车(厦门)网络科技有限公司
|
||||
</div>
|
||||
<!-- 图形验证码弹窗 -->
|
||||
<ele-modal width="320px" title="发送验证码" :visible.sync="showImgCode">
|
||||
<div class="login-input-group" style="margin-bottom: 15px">
|
||||
<el-input
|
||||
size="large"
|
||||
v-model="imgCode"
|
||||
placeholder="输入图形验证码"
|
||||
@keyup.enter.native="sendCode"
|
||||
/>
|
||||
<img
|
||||
alt=""
|
||||
:src="captcha"
|
||||
class="login-captcha"
|
||||
@click="changeImgCode"
|
||||
/>
|
||||
</div>
|
||||
<el-button
|
||||
size="large"
|
||||
type="primary"
|
||||
class="login-btn"
|
||||
:loading="codeLoading"
|
||||
@click="sendCode"
|
||||
>
|
||||
立即发送
|
||||
</el-button>
|
||||
</ele-modal>
|
||||
<!-- 实际项目去掉这段 -->
|
||||
<!-- <div
|
||||
class="hidden-xs-only"
|
||||
@@ -123,6 +97,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { forget, getCode } from '@/api/login';
|
||||
|
||||
export default {
|
||||
// eslint-disable-next-line vue/multi-word-component-names
|
||||
name: 'Forget',
|
||||
@@ -134,7 +110,7 @@
|
||||
loading: false,
|
||||
// 表单数据
|
||||
form: {
|
||||
phone: '1234567890',
|
||||
phone: '',
|
||||
password: '',
|
||||
password2: '',
|
||||
code: ''
|
||||
@@ -177,13 +153,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
// 用于刷新验证码
|
||||
v: new Date().getTime(),
|
||||
// 是否显示图形验证码弹窗
|
||||
showImgCode: false,
|
||||
// 图形验证码
|
||||
imgCode: '',
|
||||
// 发送验证码按钮loading
|
||||
codeLoading: false,
|
||||
// 验证码倒计时时间
|
||||
countdownTime: 30,
|
||||
@@ -191,12 +160,6 @@
|
||||
countdownTimer: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// 图形验证码地址
|
||||
captcha() {
|
||||
return 'https://eleadmin.com/assets/captcha?v=' + this.v;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/* 提交 */
|
||||
doSubmit() {
|
||||
@@ -205,40 +168,38 @@
|
||||
return false;
|
||||
}
|
||||
this.loading = true;
|
||||
setTimeout(() => {
|
||||
this.$message.success('密码修改成功');
|
||||
this.$router.push('/login');
|
||||
}, 1000);
|
||||
forget(this.form)
|
||||
.then((msg) => {
|
||||
this.loading = false;
|
||||
setTimeout(() => {
|
||||
this.$message.success(msg);
|
||||
this.$router.push('/login');
|
||||
}, 1000);
|
||||
})
|
||||
.catch((e) => {
|
||||
this.loading = false;
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
});
|
||||
},
|
||||
/* 更换图形验证码 */
|
||||
changeImgCode() {
|
||||
// 这里演示的验证码是后端地址直接是图片的形式, 如果后端返回base64格式请参考登录页面
|
||||
this.v = new Date().getTime();
|
||||
},
|
||||
/* 显示发送短信验证码弹窗 */
|
||||
showImgCodeCheck() {
|
||||
if (!this.form.phone) {
|
||||
this.$message.error('请输入手机号码');
|
||||
return;
|
||||
}
|
||||
this.imgCode = '';
|
||||
this.changeImgCode();
|
||||
this.showImgCode = true;
|
||||
},
|
||||
/* 发送短信验证码 */
|
||||
sendCode() {
|
||||
if (!this.imgCode) {
|
||||
this.$message.error('请输入图形验证码');
|
||||
if (!this.form.phone) {
|
||||
this.$message.error('请输入绑定手机号');
|
||||
return;
|
||||
}
|
||||
this.codeLoading = true;
|
||||
setTimeout(() => {
|
||||
this.$message.success('短信验证码发送成功, 请注意查收!');
|
||||
this.showImgCode = false;
|
||||
this.codeLoading = false;
|
||||
this.startCountdownTimer();
|
||||
}, 1000);
|
||||
getCode(this.form)
|
||||
.then((msg) => {
|
||||
this.codeLoading = true;
|
||||
setTimeout(() => {
|
||||
this.$message.success(msg);
|
||||
this.codeLoading = false;
|
||||
this.startCountdownTimer();
|
||||
}, 1000);
|
||||
})
|
||||
.catch((e) => {
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
},
|
||||
/* 开始对按钮进行倒计时 */
|
||||
startCountdownTimer() {
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
v-for="(item, index) in statistics.activityData2"
|
||||
:key="index"
|
||||
v-bind="styleResponsive ? { lg: 3, md: 8 } : { span: 3 }"
|
||||
style="width: 14.28%"
|
||||
>
|
||||
<el-card :class="item.url != '' ? 'el-header_add' : ''" shadow="never">
|
||||
<template v-slot:header>
|
||||
@@ -366,37 +365,37 @@
|
||||
/>
|
||||
<el-table-column
|
||||
prop="browse"
|
||||
label="浏览人数"
|
||||
label="浏览数(人)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="subscribe"
|
||||
label="预约人数"
|
||||
label="预约数(人)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="watch"
|
||||
label="观看人数"
|
||||
label="观看数(人)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="order"
|
||||
label="订单数"
|
||||
label="订单数(单)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="livePV"
|
||||
label="观看次数"
|
||||
label="观看数(人次)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="watchDuration"
|
||||
label="人均观看"
|
||||
label="人均观看(分)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
@@ -423,37 +422,37 @@
|
||||
/>
|
||||
<el-table-column
|
||||
prop="browse"
|
||||
label="浏览人数"
|
||||
label="浏览数(人)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="subscribe"
|
||||
label="预约人数"
|
||||
label="预约数(人)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="watch"
|
||||
label="观看人数"
|
||||
label="观看数(人次)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="order"
|
||||
label="订单数"
|
||||
label="订单数(单)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="livePV"
|
||||
label="观看次数"
|
||||
label="观看数(人次)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="watchDuration"
|
||||
label="人均观看"
|
||||
label="人均观看(分)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
@@ -474,37 +473,37 @@
|
||||
/>
|
||||
<el-table-column
|
||||
prop="browse"
|
||||
label="浏览人数"
|
||||
label="浏览数(人)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="subscribe"
|
||||
label="预约人数"
|
||||
label="预约数(人)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="watch"
|
||||
label="观看人数"
|
||||
label="观看数(人次)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="order"
|
||||
label="订单数"
|
||||
label="订单数(单)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="livePV"
|
||||
label="观看次数"
|
||||
label="观看数(人次)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="watchDuration"
|
||||
label="人均观看"
|
||||
label="人均观看(分)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user