Commit aaa18271 authored by zhangjianguo's avatar zhangjianguo

修改首页记住账号

parent f74d6ebe
......@@ -2566,12 +2566,13 @@
}
if(this.SupplierId==''){
this.Error('请选择供应商');
return false
}else {
this.addMsg.SupplierId = this.SupplierId
}
// if(this.SupplierId==''){
// this.Error('请选择供应商');
// return false
// }else {
// this.addMsg.SupplierId = this.SupplierId
// }
this.addMsg.SupplierId = this.SupplierId!='' ?this.SupplierId:0, //暂时使用
this.addMsg.SpecificationPriceList = this.SpecificationPriceList;
this.addMsg.SpecificationList = this.SpecificationList;
......
......@@ -178,15 +178,16 @@
</el-form-item>
<div class="el-form-item el-form-item--small">
<div class="el-form-item__content" style="margin-left: 0px;">
<label class="el-checkbox">
<span class="el-checkbox__input">
<span class="el-checkbox__inner"></span>
<input type="checkbox" aria-hidden="false" class="el-checkbox__original" value />
</span>
<span class="el-checkbox__label">
记住我,以后自动登录
</span>
</label>
<!--<label class="el-checkbox">-->
<!--<span class="el-checkbox__input">-->
<!--<span class="el-checkbox__inner"></span>-->
<!--<input type="checkbox" aria-hidden="false" class="el-checkbox__original" value />-->
<!--</span>-->
<!--<span class="el-checkbox__label">-->
<!--记住我,以后自动登录-->
<!--</span>-->
<!--</label>-->
<el-checkbox v-model="checked">记住我,以后自动登录</el-checkbox>
</div>
</div>
<div class="el-form-item el-form-item--small">
......@@ -239,13 +240,20 @@
// trigger: "blur"
// }]
},
checked:false
};
},
created() {
window.localStorage.clear();
localStorage.removeItem("mall_userInfo");
if (this.$route.query.mall_id) {
this.msg.MallBaseId = this.$route.query.mall_id;
}
if(localStorage.remember_login){
let re_login = JSON.parse(localStorage.remember_login)
this.msg.Account = re_login.acc;
this.msg.Password = re_login.pwd;
this.checked=re_login.checked;
}
},
methods: {
//登录
......@@ -264,6 +272,17 @@
var userData = res.data.data;
var userJson = JSON.stringify(userData);
localStorage.mall_userInfo = userJson;
if(this.checked==true){
let remember_login = JSON.stringify({
checked:this.checked,
acc:this.msg.Account,
pwd:this.msg.Password,
})
localStorage.remember_login = remember_login
}else {
localStorage.removeItem("remember_login");
}
this.$router.push({
path: "/index"
});
......@@ -285,11 +304,11 @@
},
mounted() {
if (!this.isOnline()) {
this.msg.Account = "13551126755";
this.msg.Password = "123456";
this.msg.ValidataCode = "1234";
}
// if (!this.isOnline()) {
// this.msg.Account = "13551126755";
// this.msg.Password = "123456";
// this.msg.ValidataCode = "1234";
// }
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment