AngularJS UI的路由器处理网址DOT [英] AngularJS UI-Router handling url with DOT

查看:172
本文介绍了AngularJS UI的路由器处理网址DOT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想验证使用谷歌API的用户,但在PARAMS返回数据包含压垮服务器令牌中的一个点,它基本上请求另一页是不存在的,如果我删除DOT它完美罚款。

下面是例子网址

<$p$p><$c$c>http://localhost:9000/developer/auth/google?$c$c=4/ubXcE1qq84XFtsAwT00_BWkLKR9RldGk6zhBS8ZSiTw.El_qMeir0J0coiIBeO6P2m_ee_B7kwI

这是该州处理程序

  .STATE('/开发/认证/谷歌',{
    网址:'/开发/认证/谷歌code?,
    templateUrl:意见/开发/认证/ google.html您',
    控制器:'DeveloperAuthGoogleCtrl',
    解析:{
    code:功能($ stateParams){
        返回$ stateParams code。
      }
    }
  })

感谢


解决方案

我有同样的问题。

我解决了这个改变重写规则到节点服务器。现在,我可以在任何参数使用DOT

勾选此重写规则:

  modRewrite(['\\\\ HTML |!\\\\ JS |。\\\\ SVG | \\\\ CSS | \\\\ $ PNG /index.html [L]' ])

I am trying to authenticate users using the google api, but the return data in the params contain a DOT within the token that breaks the server, it basically requests another page that isn't there if I remove the DOT it works perfectly fine.

Here is the example url

http://localhost:9000/developer/auth/google?code=4/ubXcE1qq84XFtsAwT00_BWkLKR9RldGk6zhBS8ZSiTw.El_qMeir0J0coiIBeO6P2m_ee_B7kwI

And here is the state handler

  .state('/developer/auth/google', {
    url: '/developer/auth/google?code',
    templateUrl: 'views/developer/auth/google.html',
    controller: 'DeveloperAuthGoogleCtrl',
    resolve: {
    code: function($stateParams) {
        return $stateParams.code;
      }
    }
  })

Thanks

解决方案

I had the same issue.

I fixed this changing the rewrite rule to the node server. Now I can use DOT on any param

Check this rewrite rule:

modRewrite(['!\\.html|\\.js|\\.svg|\\.css|\\.png$ /index.html [L]'])

这篇关于AngularJS UI的路由器处理网址DOT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆