如何向localStorage中存入和获取内容

2022-12-09 09:42:14
window.localStorage.setItem('token',result.data.token) 将获取到的token存入localStorage并命名为‘token’ var token=window.localStorage.getItem('token') 创建一个变量,使用window.locaStorage.getltem('token')获取locaStorage中的token字符串