Vue3 saves the data in the interface to the local

//将接口中的数据解构出来
const {data} = await Login(params)
//将token值保存到本地
window.sessionStorage.setItem('token',data.message)
//从本地取出:
const isLogin = window.sessionStorage.getItem('token')

Guess you like

Origin blog.csdn.net/qq_45079530/article/details/122930088