pull/57/head
孙萌 2023-11-24 10:12:06 +08:00
parent 57737265b5
commit 60dc3db7aa
1 changed files with 3 additions and 0 deletions

View File

@ -54,6 +54,8 @@
}, },
methods:{ methods:{
login(){ login(){
var store=this.$store.state
// "username": "xiaomeng", // "username": "xiaomeng",
// "password": "lihe12345" // "password": "lihe12345"
if(!this.username){ if(!this.username){
@ -86,6 +88,7 @@
message: '登陆成功', message: '登陆成功',
type: "success", type: "success",
}); });
store.equipmentIndex=1
localStorage.setItem('token',res.data.data.token) localStorage.setItem('token',res.data.data.token)
localStorage.setItem('userInfo',JSON.stringify(res.data.data)) localStorage.setItem('userInfo',JSON.stringify(res.data.data))
this.$router.push({ name: 'index' }) this.$router.push({ name: 'index' })