flx:去除验证码缓存

This commit is contained in:
Rain_ 2025-09-10 16:02:32 +08:00
parent 960fb9d6e1
commit d7e70362ab
2 changed files with 22 additions and 19 deletions

View File

@ -47,7 +47,7 @@ export default {
// this.canuse = res.canuse // this.canuse = res.canuse
// if(res.canuse){ // if(res.canuse){
if (!this.imgCode) { if (!this.imgCode) {
this.$message.error("请输入验证码!"); //, this.$message.error("请输入验证码"); //,
return; return;
} }
// //

View File

@ -109,6 +109,7 @@
<el-form-item label="" prop="account"> <el-form-item label="" prop="account">
<el-input <el-input
v-model="form.account" v-model="form.account"
@input="imageCodeFlag = ''"
style="height: 53px; font-size: 16px" style="height: 53px; font-size: 16px"
:placeholder="$t('message.login.account_placeholder')" :placeholder="$t('message.login.account_placeholder')"
> >
@ -184,11 +185,7 @@
/> />
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item style="margin-top: 25px" label="" prop="imgCode">
style="margin-top: 25px"
label=""
prop="imgCode"
>
<div class="codebox"> <div class="codebox">
<el-input <el-input
v-model="form2.imgCode" v-model="form2.imgCode"
@ -229,7 +226,13 @@
class="inputIcon" class="inputIcon"
/> />
<div slot="suffix" style="margin: 6px 10px 0 0"> <div slot="suffix" style="margin: 6px 10px 0 0">
<getcode @getImgCodeLogin="getImgCodeLogin" :phone="form2.phone" :imgCode="form2.imgCode" :captchaId="captchaId" type="theme2"></getcode> <getcode
@getImgCodeLogin="getImgCodeLogin"
:phone="form2.phone"
:imgCode="form2.imgCode"
:captchaId="captchaId"
type="theme2"
></getcode>
</div> </div>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -779,9 +782,9 @@ export default {
this.getDetail(this.headquartersSnData); this.getDetail(this.headquartersSnData);
this.getData(); this.getData();
this.getImgCodeLogin(); this.getImgCodeLogin();
if (window.localStorage.getItem("imageCodeFlag")) { // if (window.localStorage.getItem("imageCodeFlag")) {
this.imageCodeFlag = window.localStorage.getItem("imageCodeFlag"); // this.imageCodeFlag = window.localStorage.getItem("imageCodeFlag");
} // }
} }
}, },
mounted() { mounted() {
@ -1186,19 +1189,19 @@ export default {
} else { } else {
this.imageCodeFlag = res.code; this.imageCodeFlag = res.code;
} }
if (this.imageCodeFlag == 3006) { // if (this.imageCodeFlag == 3006) {
localStorage.setItem( // localStorage.setItem(
"imageCodeFlag", // "imageCodeFlag",
JSON.stringify(this.imageCodeFlag) // JSON.stringify(this.imageCodeFlag)
); // );
} // }
this.getImgCodeLogin(); this.getImgCodeLogin();
this.$message.error(res.message); this.$message.error(res.message);
return; return;
} }
if (window.localStorage.getItem("imageCodeFlag")) { // if (window.localStorage.getItem("imageCodeFlag")) {
window.localStorage.removeItem("imageCodeFlag"); // window.localStorage.removeItem("imageCodeFlag");
} // }
// //
if (res.result.expire) { if (res.result.expire) {
this.addPasswordDialog = true; this.addPasswordDialog = true;