最近我在使用react
+react-router
开发spa,后台使用的是yii2
。nignx
设置的是当404
就返回index.html
。但是这样子有个问题是,我没有办法使用csrf
的保护,这样子要怎么解决呢?
我看到了一个网站使用的技术栈和我的差不多,我看了它是在head标签上面写了一个含有token
值的meta标签,而它的每一个请求都会将这个token
作为header
的值发回去。这样子要怎么做?要怎么将token
值渲染到这个index.html
里头?
ajax 提交的
将输出部分放在header头里