This commit is contained in:
hrx 2026-04-27 10:16:16 +08:00
parent 89fed5a6ea
commit f31a47f56c

View File

@ -121,7 +121,8 @@
</div>
</el-form>
<!-- 重置密码对话框 -->
<!-- 重置密码对话框暂时注释 -->
<!--
<el-dialog title="重置密码" :visible.sync="dialogVisible" width="25%" class="myDialog">
<el-form ref="form" :model="form" label-width="100px" :rules="forms">
<el-form-item label="用户名:" prop="username" class="rePassword" style="background-color: white">
@ -150,6 +151,7 @@
</div>
</el-form>
</el-dialog>
-->
</div>
</div>
</div>
@ -178,12 +180,12 @@
import {
getCodeAPI, // API
getLogoAPI, // LogoAPI
getPasswordCodeAPI, // API
// getPasswordCodeAPI, // API
logintypeAPI, // API
loginUserAPI, // API
reqGetAppidAPI, // AppID API
reqGetCodeAPI, // API
retrieveCodeAPI, // API,
// retrieveCodeAPI, // API,
} from "@/api/login";
import store from "@/store";
@ -222,22 +224,15 @@ export default {
//
SendCode_text: "获取验证码", //
SendCode_text1: "获取验证码", //
isDisabled: false, //
isDisabled1: false, //
time_count: 60, //
time_count1: 60, //
timer: null, //
timer1: null, //
//
isGettingCode: false, //
isGettingCode1: false, //
debounceTimer: null, //
debounceTimer1: null, //
//
dialogVisible: false, //
loading: false, //
//
@ -266,21 +261,20 @@ export default {
capsTooltip: false,
passwordType: "password", // passwordtext
//
form: {
username: "", //
vcode: "", //
password: "", //
id: "", // ID
codeid: "", // ID
},
//
// form: {
// username: "", //
// vcode: "", //
// password: "", //
// id: "", // ID
// codeid: "", // ID
// },
//
forms: {
username: [{ required: true, message: "请输入姓名", trigger: "blur" }],
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
vcode: [{ required: true, message: "请输入验证码", trigger: "blur" }],
},
// forms: {
// username: [{ required: true, message: "", trigger: "blur" }],
// password: [{ required: true, message: "", trigger: "blur" }],
// vcode: [{ required: true, message: "", trigger: "blur" }],
// },
// Logo
isLogo: false,
@ -331,7 +325,6 @@ export default {
beforeDestroy() {
//
clearInterval(this.timer)
clearInterval(this.timer1)
clearInterval(this.getCodeTimer)
window.removeEventListener('keydown', this.handleEnter);
@ -384,21 +377,19 @@ export default {
}, 300);
},
//
debouncedGetCode1: function () {
if (this.isDisabled1 || this.isGettingCode1) return;
this.isGettingCode1 = true;
//
clearTimeout(this.debounceTimer1);
// 300ms
this.debounceTimer1 = setTimeout(() => {
this.getCode1();
this.isGettingCode1 = false;
}, 300);
},
//
// debouncedGetCode1: function () {
// if (this.isDisabled1 || this.isGettingCode1) return;
//
// this.isGettingCode1 = true;
//
// clearTimeout(this.debounceTimer1);
//
// this.debounceTimer1 = setTimeout(() => {
// this.getCode1();
// this.isGettingCode1 = false;
// }, 300);
// },
//
goBaidu(listUrl, url) {
@ -753,56 +744,53 @@ export default {
});
},
//
getCode1() {
//
if (!this.form.username || !/^1[3-9]\d{9}$/.test(this.form.username)) {
this.$message.error('请输入正确的手机号');
return;
}
// 使APImobileaction_type
retrieveCodeAPI({
mobile: this.form.username,
action_type: 'login'
}).then((res) => {
if (res.status == true) {
this.form.id = res.userid;
this.form.codeid = res.codeid;
let that = this;
this.time_count1 = 59;
this.isDisabled1 = true;
this.SendCode_text1 = "重新发送" + this.time_count1 + "s";
if (!that.timer1) {
that.timer1 = setInterval(() => {
if (that.time_count1 > 0) {
that.time_count1--;
that.SendCode_text1 = "重新发送" + that.time_count1 + "s";
} else {
that.SendCode_text1 = "获取验证码";
clearInterval(that.timer1);
that.timer1 = null;
this.isDisabled1 = false;
that.time_count1 = 60;
}
}, 1000);
}
this.$message({
message: "验证码已发送,请注意查收。",
type: "success",
});
} else {
this.$message({
message: res.msg,
type: "error",
});
}
}).catch(error => {
this.isGettingCode1 = false;
this.$message.error('验证码获取失败');
});
},
// getCode1() {
// if (!this.form.username || !/^1[3-9]\d{9}$/.test(this.form.username)) {
// this.$message.error('');
// return;
// }
//
// retrieveCodeAPI({
// mobile: this.form.username,
// action_type: 'login'
// }).then((res) => {
// if (res.status == true) {
// this.form.id = res.userid;
// this.form.codeid = res.codeid;
// let that = this;
// this.time_count1 = 59;
// this.isDisabled1 = true;
// this.SendCode_text1 = "" + this.time_count1 + "s";
//
// if (!that.timer1) {
// that.timer1 = setInterval(() => {
// if (that.time_count1 > 0) {
// that.time_count1--;
// that.SendCode_text1 = "" + that.time_count1 + "s";
// } else {
// that.SendCode_text1 = "";
// clearInterval(that.timer1);
// that.timer1 = null;
// this.isDisabled1 = false;
// that.time_count1 = 60;
// }
// }, 1000);
// }
// this.$message({
// message: "",
// type: "success",
// });
// } else {
// this.$message({
// message: res.msg,
// type: "error",
// });
// }
// }).catch(error => {
// this.isGettingCode1 = false;
// this.$message.error('');
// });
// },
//
handleClick(tab, event) {
@ -939,11 +927,10 @@ export default {
});
},
//
resetPassword() {
this.dialogVisible = true;
this.$refs.loginForm.resetFields();
},
// resetPassword() {
// this.dialogVisible = true;
// this.$refs.loginForm.resetFields();
// },
//
handleRegister() {
@ -951,41 +938,39 @@ export default {
this.$router.push({ name: "registrationPage" });
},
//
cancelReset() {
this.dialogVisible = false;
this.$refs.form.resetFields();
},
// cancelReset() {
// this.dialogVisible = false;
// this.$refs.form.resetFields();
// },
//
handleSubmit() {
let parmas = {
id: this.form.id,
password: this.form.password,
codeid: this.form.codeid,
vcode: this.form.vcode,
};
getPasswordCodeAPI(parmas).then((res) => {
if (res.status == true) {
this.$message({
message: "密码重置成功",
type: "success",
});
this.isDisabled1 = false;
this.dialogVisible = false;
this.SendCode_text1 = "获取验证码";
clearInterval(this.timer1);
this.timer1 = null;
this.time_count1 = 60;
this.$refs.form.resetFields();
} else {
this.$message({
message: res.msg,
type: "error",
});
}
});
},
// handleSubmit() {
// let parmas = {
// id: this.form.id,
// password: this.form.password,
// codeid: this.form.codeid,
// vcode: this.form.vcode,
// };
// getPasswordCodeAPI(parmas).then((res) => {
// if (res.status == true) {
// this.$message({
// message: "",
// type: "success",
// });
// this.isDisabled1 = false;
// this.dialogVisible = false;
// this.SendCode_text1 = "";
// clearInterval(this.timer1);
// this.timer1 = null;
// this.time_count1 = 60;
// this.$refs.form.resetFields();
// } else {
// this.$message({
// message: res.msg,
// type: "error",
// });
// }
// });
// },
}
}
</script>