登录时,记住账号和密码。点击radio取消,就取消账号密码记住
radio点击
checkedTap1(){
this.radioPactChecked = !this.radioPactChecked
},
点击登录
login() {
if(this.radioPactChecked){
this.loading = true
this.$H.post('/login', {
"username": this.username,
"password": this.password,
}).then(res => {
if (res.code === 200) {
if(this.rememberPsdChecked){
uni.setStorageSync('username', this.username);
uni.setStorageSync('password', this.password);
}else{
uni.removeStorageSync('username');
uni.removeStorageSync('password');
}
}
})
}else{
uni.showToast({
title: "请阅读并同意用户协议",
icon: 'error',
duration: 2000
});
}
},