2019独角兽企业重金招聘Python工程师标准>>>
在使用token的出现错误
复制代码
1
2
3
4
5
6
7{ "name": "Unauthorized", "message": "Your request was made with invalid credentials.", "code": 0, "status": 401, "type": "yii\web\UnauthorizedHttpException" }
很可能是由于apache服务器上需要配置.htaccess文件,要加上一行:
SetEnvIf Authorization “(.*)” HTTP_AUTHORIZATION=$1
复制代码
1
2
3
4
5
6
7
8
9
10
11Options +FollowSymLinks IndexIgnore */* RewriteEngine on # if a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # otherwise forward it to index.php RewriteRule . index.php SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
转载于:https://my.oschina.net/u/3648322/blog/1920998
最后
以上就是可靠小蚂蚁最近收集整理的关于Yii的api无法认证Authorization的错误的全部内容,更多相关Yii内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复