2016-09-29 09:20

使用$ http然后重定向AngularJS注销

  • laravel
  • php
  • angularjs

Right so I have a little dilemma here :).

I'm working on a project that is built with angularjs and Laravel. Login is done with laravel which is out of AngularJs "scope", should I say.

So in Front End I do not see that page.

What I'm trying to do is use $http get method to get /logout (handled by laravel again). On success redirect user to /login.

So what I was thinking of doing is:

$rootScope.logout = function () {

        $http.get('/logout', function (response) {

But doesn't seem to work for some reason. Suggestions? /logout clears all sessions etc, which is out of my "jurisdiction" :)

Btw I'm also using UI-router.

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享