Thinkphp 使用header接收参数
2022-11-24 11:10:29
256
{{single.collect_count}}

如果直接使用$request->header接值,这里是接收不到值的 

首先要在public/.htaccess添加一句

SetEnvIf Authorization “(.*)” HTTP_AUTHORIZATION=$1

在header传值

 

接值

$token=$request->header('token');

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}