在request.js的js中加入本地储存的jwt
newOptions.headers = {
...newOptions.headers,
Authorization: `Bearer ${localStorage.getItem('token')}`,
}
代码例子如图片
在request.js的js中加入本地储存的jwt
newOptions.headers = {
...newOptions.headers,
Authorization: `Bearer ${localStorage.getItem('token')}`,
}
代码例子如图片