main
jn517618 2 years ago
parent 3314c88815
commit 07cc682894
  1. BIN
      dist.zip
  2. 27
      src/page/login/userlogin.vue

Binary file not shown.

@ -149,8 +149,8 @@ export default {
] ]
}, },
checked: false, checked: false,
deptData:[], deptData: [],
deptName:'', deptName: '',
}; };
}, },
created() { created() {
@ -216,7 +216,7 @@ export default {
this.handleLogin(); this.handleLogin();
done(); done();
}, },
handleLogin() { handleLogin() {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate(valid => {
if (valid) { if (valid) {
@ -226,10 +226,10 @@ export default {
spinner: "el-icon-loading" spinner: "el-icon-loading"
}); });
this.$store.dispatch("LoginByUsername", this.loginForm).then(() => { this.$store.dispatch("LoginByUsername", this.loginForm).then(() => {
setStore({ name: 'checked', content: this.checked, type: 'boolean' }) setStore({ name: 'checked', content: this.checked })
if (this.checked) { if (this.checked) {
setStore({ name: 'username', content: this.loginForm.username, type: 'string' }) setStore({ name: 'username', content: this.loginForm.username })
setStore({ name: 'password', content: this.loginForm.password, type: 'string' }) setStore({ name: 'password', content: this.loginForm.password })
} else { } else {
removeStore({ name: 'username' }) removeStore({ name: 'username' })
removeStore({ name: 'password' }) removeStore({ name: 'password' })
@ -248,12 +248,12 @@ export default {
} }
} }
console.log('user ==========>',this.userInfo) console.log('user ==========>', this.userInfo)
if(this.userInfo.role_name == '政府大屏'){ if (this.userInfo.role_name == '政府大屏') {
this.$router.push({ path: '/energySourcesProvince/index' }); this.$router.push({ path: '/energySourcesProvince/index' });
}else if(this.userInfo.role_name == '厂区大屏'){ } else if (this.userInfo.role_name == '厂区大屏') {
this.$router.push({ path: '/energySources/index',query:{deptId:this.userInfo.dept_id} }); this.$router.push({ path: '/energySources/index', query: { deptId: this.userInfo.dept_id } });
}else{ } else {
this.$router.push({ path: this.tagWel.value }); this.$router.push({ path: this.tagWel.value });
} }
loading.close(); loading.close();
@ -276,11 +276,6 @@ export default {
this.$parent.$refs.login.style.backgroundImage = `url(${data.data.backgroundUrl})`; this.$parent.$refs.login.style.backgroundImage = `url(${data.data.backgroundUrl})`;
} }
}) })
},
onChange(v) {
if (v) {
setStore({ name: 'username', content: this.loginForm.username })
}
} }
} }
}; };

Loading…
Cancel
Save