Open wanquantong opened 8 hours ago
1.登录,将token保存到localStorage,token获取到了,跳转页面到首页,也跳转成功,
if (payload.token != "") { localStorage.setItem("token", payload.token); localStorage.setItem("xtoken", payload.xtoken); console.log(payload.token); }
2.首页:CRUD增删改查表格,接口的请求头,赋值localStorage,没效果。 请问怎么实现?
"headers": { "token": "${localStorage.getItem('token')}" }
用法不对,看官方文档
https://aisuda.bce.baidu.com/amis/zh-CN/docs/concepts/data-mapping#namespace
Amis低代码前端框架交流群【QQ1群】:717791727 Amis低代码前端框架交流群【QQ2群】:721182449
实现场景:(amis版本:6.9)
1.登录,将token保存到localStorage,token获取到了,跳转页面到首页,也跳转成功,
2.首页:CRUD增删改查表格,接口的请求头,赋值localStorage,没效果。 请问怎么实现?