mirror of
https://gitee.com/XiaoLFeng/JSL_OrganizeInternalOA_Web.git
synced 2025-06-08 11:43:04 +08:00
存储token
This commit is contained in:
parent
7f5fc1de4f
commit
23177f70af
@ -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")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user