多语言展示
当前在线:1676今日阅读:193今日分享:47

前端是vue 接口使用yii2 报 401 Unauthorized

刚接手了一个yii2框架的项目,后台的前端是vue做的,yii提供接口,访问http://www.back.com/#/login报:{'name':'Unauthorized','message':'Your request was made with invalid credentials.','code':0,'status':401,'type':'yii\\web\\UnauthorizedHttpException'},没经授权,我访问的是登录页怎么还是没经授权,经查询,其实是路径问题。
方法/步骤
1

访问http://****/#/login报{'name':'Unauthorized','message':'Your request was made with invalid credentials.','code':0,'status':401,'type':'yii\\web\\UnauthorizedHttpException'}

推荐信息