前端登录的逻辑
1 this.$refs.loginForm.validate(async (valid) => { 2 if (valid) { 3 this.loading = true 4 let res = await loginApi(this.loginForm) 5 if (String(res.code) === '1') { 6 localStorage.setItem('userInfo',JSON.stringify(res.data)) 7 window.location.href= '/backend/index.html' 8 } else { 9 this.$message.error(res.msg) 10 this.loading = false 11 } 12 } 13 })

浙公网安备 33010602011771号