Commit aaa18271 authored by zhangjianguo's avatar zhangjianguo

修改首页记住账号

parent f74d6ebe
...@@ -2566,12 +2566,13 @@ ...@@ -2566,12 +2566,13 @@
} }
if(this.SupplierId==''){ // if(this.SupplierId==''){
this.Error('请选择供应商'); // this.Error('请选择供应商');
return false // return false
}else { // }else {
this.addMsg.SupplierId = this.SupplierId // this.addMsg.SupplierId = this.SupplierId
} // }
this.addMsg.SupplierId = this.SupplierId!='' ?this.SupplierId:0, //暂时使用
this.addMsg.SpecificationPriceList = this.SpecificationPriceList; this.addMsg.SpecificationPriceList = this.SpecificationPriceList;
this.addMsg.SpecificationList = this.SpecificationList; this.addMsg.SpecificationList = this.SpecificationList;
......
...@@ -178,15 +178,16 @@ ...@@ -178,15 +178,16 @@
</el-form-item> </el-form-item>
<div class="el-form-item el-form-item--small"> <div class="el-form-item el-form-item--small">
<div class="el-form-item__content" style="margin-left: 0px;"> <div class="el-form-item__content" style="margin-left: 0px;">
<label class="el-checkbox"> <!--<label class="el-checkbox">-->
<span class="el-checkbox__input"> <!--<span class="el-checkbox__input">-->
<span class="el-checkbox__inner"></span> <!--<span class="el-checkbox__inner"></span>-->
<input type="checkbox" aria-hidden="false" class="el-checkbox__original" value /> <!--<input type="checkbox" aria-hidden="false" class="el-checkbox__original" value />-->
</span> <!--</span>-->
<span class="el-checkbox__label"> <!--<span class="el-checkbox__label">-->
记住我,以后自动登录 <!--记住我,以后自动登录-->
</span> <!--</span>-->
</label> <!--</label>-->
<el-checkbox v-model="checked">记住我,以后自动登录</el-checkbox>
</div> </div>
</div> </div>
<div class="el-form-item el-form-item--small"> <div class="el-form-item el-form-item--small">
...@@ -239,13 +240,20 @@ ...@@ -239,13 +240,20 @@
// trigger: "blur" // trigger: "blur"
// }] // }]
}, },
checked:false
}; };
}, },
created() { created() {
window.localStorage.clear(); localStorage.removeItem("mall_userInfo");
if (this.$route.query.mall_id) { if (this.$route.query.mall_id) {
this.msg.MallBaseId = 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: { methods: {
//登录 //登录
...@@ -264,6 +272,17 @@ ...@@ -264,6 +272,17 @@
var userData = res.data.data; var userData = res.data.data;
var userJson = JSON.stringify(userData); var userJson = JSON.stringify(userData);
localStorage.mall_userInfo = userJson; 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({ this.$router.push({
path: "/index" path: "/index"
}); });
...@@ -285,11 +304,11 @@ ...@@ -285,11 +304,11 @@
}, },
mounted() { mounted() {
if (!this.isOnline()) { // if (!this.isOnline()) {
this.msg.Account = "13551126755"; // this.msg.Account = "13551126755";
this.msg.Password = "123456"; // this.msg.Password = "123456";
this.msg.ValidataCode = "1234"; // 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