存储token

This commit is contained in:
yannqing 2024-01-20 02:27:32 +08:00
parent 7f5fc1de4f
commit 23177f70af

View File

@ -76,7 +76,7 @@ const data = {
} }
function loginUser(){ function loginUser(){
requests.login(data).then((res) => { requests.login(data).then((res) => {
console.log(res) console.log(res)
message.config({ message.config({
background: true background: true
@ -84,6 +84,7 @@ requests.login(data).then((res) => {
if (res.data.code === 200) { if (res.data.code === 200) {
//++ //++
//manager //manager
window.localStorage.setItem('token',res.data.data.token)
if (res.data.data.role.rid===1) { if (res.data.data.role.rid===1) {
router.push("/manager") router.push("/manager")