zoukankan      html  css  js  c++  java
  • 新浪微博开发flash SDK,判断登录状态不正常

    在IE9中(IE8也是),其它版本没测试过。火狐正常。
    两个包含flash的页面,第一个页面的flash有如下代码 _mb.addEventListener(MicroBlogEvent.ANYWHERE_TOKEN_RESULT, onLoginResult); _mb.addEventListener(MicroBlogErrorEvent.ANYWHERE_TOKEN_ERROR, onLoginError); 当onLoginError被调用时就跳转到第二个页面,第二个页面让用户点击login按钮登录并且加载用户信息,登录成功之后跳转回到第一个页面,可是第一个页面这时访问"http://api.t.sina.com/flash/query.jsp?source=xxxx"时由于浏览器的缓存,返回的是304(并且实际上没有访问网络),而不是形如{"sucess":1,"anywhereToken":"58763268a407f1966f8708a10af1a17a","status":1}的返回值,所以它认为还是没有登录的,所以又跳转了第二个页面。

    打开MicroBlog.as 把里面的第1359行“var url:String = "http://api.t.sina.com.cn/flash/query.jsp?source=" + _source”改成带个随机数的url,“var url:String = "http://api.t.sina.com.cn/flash/query.jsp?source=" + _source + '&t='+ Math.random();”这样浏览器就不会缓存这个请求了。

  • 相关阅读:
    Attributes in C#
    asp.net C# 时间格式大全
    UVA 10518 How Many Calls?
    UVA 10303 How Many Trees?
    UVA 991 Safe Salutations
    UVA 10862 Connect the Cable Wires
    UVA 10417 Gift Exchanging
    UVA 10229 Modular Fibonacci
    UVA 10079 Pizza Cutting
    UVA 10334 Ray Through Glasses
  • 原文地址:https://www.cnblogs.com/k1988/p/2165593.html
Copyright © 2011-2022 走看看