1234 |
- <!DOCTYPE html>
- <!-- saved from url=(0049)https://open.t.qq.com/oauth2/openjs/proxy_v3.html -->
- <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script>(function(){var e,t=window.T;e={name:"OpenJS",version:"3.0",debug:1,noConflict:function(){return window.T=t,e},copy:function(e,t,n,r){for(var i in t)if(n||typeof e[i]=="undefined")e[i]=r?r(t[i]):t[i];return e},create:function(e,t){var n=this,r=e?e.split("."):[],i=r.length;for(var s=0;s<i;s++){var o=r[s],u=n[o];u||(u=t&&s+1===i?t:{},n[o]=u),n=u}return n},extend:function(t,n,r){return e.copy(typeof t=="string"?e.create.call(this,t):t,n,r)},uid:function(e){var t;e=e||6,t=Math.random().toString(16).substr(2);if(t.length>e)t=t.substr(0,e);else if(t.length<e)for(var n=0,r=e-t.length;n<r;n++)t+=Math.random().toString(16).substr(2,1);return t}},function(){var n,r,i,s,o,u,a,f,l,c="boolean",h="number",p="string",d=/openjs\.js(.*)$/,v=/openjs\.proxy\.js(.*)$/,m,g={},y={debug:{type:c,"default":e.debug},loglevel:{type:h,"default":0},cookiedomain:{type:p,"default":""},cookiepath:{type:p,"default":"/"},crossdomainmethod:{type:p,"default":"auto"},autoboot:{type:c,"default":!0}},b,w,E,S=document.getElementsByTagName("script"),x,T;b=function(t){t=E(t).toLowerCase();switch(t){case"no":case"off":case"false":return!1}return!!t},w=function(t,n){return parseInt(E(t),n)||0},E=String.prototype.trim?function(e){return e?String.prototype.trim.call(e):""}:function(e){return e?e.toString().replace(/^\s+/,"").replace(/\s+$/,""):""};for(x=0,T=S.length;x<T&&(u=S[x]);x++){n=u.getAttribute("src",4)||u.src;if(n){m=n.match(d)||n.match(v);if(m){r=m[1],i=r.split("#").pop(),s=r.indexOf("?")===0?r.slice(1,r.indexOf("#")==-1?o:r.indexOf("#")):"";break}}}if(i){i=i.split("&");for(x=0,T=i.length;x<T&&(u=i[x]);x++){u=u.split("="),a=u[0].toLowerCase(),f=u.length>1?u[1]:o;if(y.hasOwnProperty(a)){l=y[a];switch(l.type){case c:f=b(f);break;case h:f=w(f,10);break;default:f=E(f)}g[a]=f}}}for(var N in y)y.hasOwnProperty(N)&&!g.hasOwnProperty(N)&&(g[N]=y[N]["default"]);e.extend("envs",g)}(),e.debug=e.envs.debug,e.provide=e.create,window.QQWB=window.T=e})(),QQWB.extend("Object",{create:function(){return Object.create?Object.create:function(e,t){var n=function(){};return n.prototype=e,new n}}(),forEach:function(e,t,n,r){for(var i in e)r?t.call(n,e[i],i,e):e.hasOwnProperty(i)&&t.call(n,e[i],i,e)},isObject:function(e){return Object.prototype.toString.call(e)=="[object Object]"}}),QQWB.extend("String",{_trimLeft:/^\s+/,_trimRight:/\s+$/,isString:function(e){return typeof e=="string"},ltrim:function(e){return e?e.toString().replace(this._trimLeft,""):""},rtrim:function(e){return e?e.toString().replace(this._trimRight,""):""},trim:String.prototype.trim?function(e){return e?String.prototype.trim.call(e):""}:function(e){return e?e.toString().replace(this._trimLeft,"").replace(this._trimRight,""):""},startsWith:String.prototype.startsWith?function(e,t){return e?String.prototype.startsWith.call(e,t):!1}:function(e,t){return e?e.toString().indexOf(t)===0:!1},endsWith:String.prototype.endsWith?function(e,t){return e?String.prototype.endsWith.call(e,t):!1}:function(e,t){return e?e.toString().lastIndexOf(t)>=0&&e.toString().lastIndexOf(t)+t.length==e.length:!1},replaceAll:function(e,t,n){var r;e=e||"";do r=e,e=e.replace(t,n);while(r!=e);return e},splitby:function(e,t){var n=QQWB.String,r="[****]";t=n.replaceAll(t,"\\"+e,r),t=t.split(e);for(var i=0,s=t.length;i<s;i++)t[i]=n.replaceAll(t[i],r,"|");return t}}),QQWB.extend("XML",{isXML:function(e){},toString:function(e){return this.stringify(e)},stringify:function(e){var t;return window.ActiveXObject?t=e.xml:t=(new XMLSerializer).serializeToString(e),t},fromString:function(e){var t;if(window.ActiveXObject)t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e);else{var n=new DOMParser;t=n.parseFromString(e,"text/xml")}return t}},!0),function(){function t(e,t){var n=QQWB,r=n.String;return r.isString(e)||n.log.warn("bigtable inName is not a str"),r.isString(t)||n.log.warn("bigtable inKey is not a str"),["bt",e,t].join("_")}var e={};QQWB.extend("bigtable",{put:function(n,r,i){var s=t(n,r);return e[s]=i,e[s]},get:function(n,r,i){var s=t(n,r),o=e[s],u;return i!=u&&o==u?i:o},del:function(n,r){var i=t(n,r);try{delete e[i]}catch(s){e[i]=null}},has:function(n,r){var i=t(n,r);return e.hasOwnProperty(i)},_:function(){return e}}),QQWB.bigtable.set=QQWB.bigtable.put}(),QQWB.extend("time",{now:function(){return this.dateNow().getTime()},secondsNow:function(){return Math.round(this.now()/1e3)},dateNow:function(){return new Date},shortTime:function(e,t){var n;return e instanceof Date||(t=e,e=this.dateNow()),[e.getFullYear(),"/",e.getMonth(),"/",e.getDate()," ",(n=e.getHours())&&n<10?"0"+n:n,":",(n=e.getMinutes())&&n<10?"0"+n:n,":",(n=e.getSeconds())&&n<10?"0"+n:n].join("")}}),QQWB.extend("log",{CRITICAL:50,ERROR:40,WARNING:30,INFO:20,DEBUG:10,NOTSET:0,_level:0,setLevel:function(e){return this._level=e,this},debug:function(e){return this.DEBUG>=this._level&&this._out("DEBUG",e),this},info:function(e){return this.INFO>=this._level&&this._out("INFO",e),this},warning:function(e){return this.WARNING>=this._level&&this._out("WARNING",e),this},error:function(e){return this.ERROR>=this._level&&this._out("ERROR",e),this},critical:function(e){return this.CRITICAL>=this._level&&this._out("CRITICAL",e),this},_out:function(e,t){var n=QQWB,r=n.bigtable,i;output=[window.name?window.name:"",window.opener||window.name===r.get("oauthwindow","name")?"#":"",window!=window.parent?"*":"",n.name,": ","["+e+"] ",n.time.shortTime()+" ",t].join(""),i=r.get("log","latest"),i||(i=r.put("log","latest",[])),i.length>=200&&i.shift(),i.push(output),QQWB.debug&&window.console&&window.console.log(output)},last:function(e){var t=QQWB.bigtable.get("log","latest");return t&&e&&(t=t.slice(0,e)),t?t.join("\n"):""}}),QQWB.log.warn=QQWB.log.warning,QQWB.log.setLevel(QQWB.envs.loglevel),QQWB.extend("queryString",{encode:function(e,t,n,r){var i=/%20/g,s=t||"&",o=n||encodeURIComponent,u=[],a=[],f,l;for(f in e)if(e.hasOwnProperty(f)){l=e[f];if(l!==null&&typeof l!="undefined"){f=o(f).replace(i,"+"),l=o(l).replace(i,"+");if(!r)u.push(f+"="+l);else for(var c=0,h=r.length;c<h;c++)r[c]===f&&(u[c]=f+"="+l)}}for(var p=0,d=u.length;p<d;p++)typeof u[p]!="undefined"&&a.push(u[p]);return u=a,a=null,u.join(s)},decode:function(e,t,n){var r=n||decodeURIComponent,i=t||"&",s=e.split(i),o={},u;for(var a=0,f=s.length;a<f;a++)u=s[a].split("=",2),u&&u[0]&&(o[r(u[0])]=r(u[1]));return o}}),QQWB.extend("Function",{isFunction:function(e){return typeof e=="function"}}),QQWB.extend("Array",{isArray:function(e){return Object.prototype.toString.call(e)==="[object Array]"},inArray:function(e,t){for(var n=0,r=e.length;n<r;n++)if(t===e[n])return!0;return!1},fromString:function(e,t,n){return QQWB.String.isString(e)?(t=t||"",n?e.split(t,n):e.split(t)):[]},fromArguments:function(e,t){return typeof e!="object"?[]:t?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e)},toArray:function(e){return typeof e=="string"?e.split(""):typeof e=="object"?Array.prototype.slice.call(e,0):this.toArray(e.toString())},each:function(e,t){for(var n=0,r=e.length;n<r;n++)if(!1===t(n,e[n]))break},forEach:function(e,t,n){var r=[];if(e){var i=n||this;for(var s=0,o=e.length,u;s<o;s++)u=t.call(i,e[s],s,e),u!==undefined&&r.push(u)}return r},get:function(e,t){var n=e.length;if(Math.abs(t)<n)return t>=0?e[t]:e[n+t]}}),function(){var e;e=function(){var e=[],t,n,r,i={done:function(){if(!r){var n=arguments,s,o;t&&(o=t,t=0);for(var u=0,a=n.length;u<a;u++)s=n[u],QQWB.Array.isArray(s)?i.done.apply(i,s):QQWB.Function.isFunction(s)&&e.push(s);o&&i.resolveWith(o[0],o[1])}return this},resolveWith:function(i,s){if(!r&&!t&&!n){s=s||[],n=1;try{while(e[0])e.shift().apply(i,s)}finally{t=[i,s],n=0}}return this},resolve:function(){return i.resolveWith(this,arguments),this},isResolved:function(){return!!n||!!t},cancel:function(){return r=1,e=[],this}};return i},QQWB.extend("deferred",{deferred:function(t){var n,r=e(),i=e();return QQWB.extend(r,{fail:i.done,then:function(e,t){return r.done(e).fail(t),this},always:function(){return r.done.apply(r,arguments).fail.apply(this,arguments)},rejectWith:i.resolveWith,reject:i.resolve,isRejected:i.isResolved,promise:function(e){var t="done fail isResolved isRejected promise then always success error complete whatever".split(" ");if(e==null){if(n)return n;n=e={}}var i=t.length;while(i--)e[t[i]]=r[t[i]];return e}}),r.success=r.done,r.error=r.fail,r.complete=r.whatever=r.always,r.done(i.cancel).fail(r.cancel),delete r.cancel,t&&t.call(r,r),r},when:function(e){function s(e){return function(n){t[e]=arguments.length>1?QQWB.Array.fromArguments(arguments):n,--r||i.resolveWith(i,QQWB.Array.fromArguments(t))}}var t=arguments,n=t.length,r=n,i=n<=1&&e&&QQWB.Function.isFunction(e.promise)?e:QQWB.deferred.deferred();if(n>1)for(var o=0;o<n;o++)t[o]&&QQWB.Function.isFunction(t[o].promise)?t[o].promise().then(s(o),i.reject):--r,r||i.resolveWith(i,t);else i!==e&&i.resolveWith(i,n?[e]:[]);return i.promise()}}),QQWB.task=QQWB.when=QQWB.deferred.when}(),function(){var e=QQWB,t=e.bigtable,n=e.log,r=e.String,i="://open.t.qq.com",s="http"+i,o=document.location.protocol.replace(":",""),u="https"+i,a=o+i;t.put("innerauth","layerid","openjslayer"+QQWB.uid(5)),t.put("innerauth","originaldomain",document.domain),t.put("innerauth","rootdomain","qq.com"),t.put("innerauth","enabled",document.domain!="open.t.qq.com"&&r.endsWith(document.domain,t.get("innerauth","rootdomain"))),t.put("innerauth","eventproxyready","InnerAuthProxyFrameReady"),t.put("innerauth","eventproxysizechange","InnerAuthProxySizeChange"),t.put("innerauth","eventproxysubmit","InnerAuthResult"),t.put("innerauth","eventproxycancel","InnerAuthRequestCancel"),t.put("uri","html5proxy",[t.get("innerauth","enabled")?a:u,"/oauth2/openjs/proxy_v3.html"].join("")),t.put("uri","api",[a,"/api"].join("")),t.put("uri","exchangetoken",[a,"/cgi-bin/oauth2/access_token"].join("")),t.put("uri","gettokenbypt",[a,"/cgi-bin/oauth2/get_oauth2token_pt"].join("")),t.put("uri","apiforflash",[u,"/api"].join("")),t.put("uri","auth",[u,"/cgi-bin/oauth2/authorize"].join("")),t.put("uri","flashas3proxy",[u,"/oauth2/openjs/proxy_as3_v3.swf"].join("")),t.put("uri","innerauth",[t.get("innerauth","enabled")?a:s,"/cgi-bin/oauth2/inner_flow_page?pagetype=2"].join("")),t.put("oauthwindow","name","authClientProxy_ee5a0f93"),t.put("oauthwindow","width","630"),t.put("oauthwindow","height","480"),t.put("cookie","domain",QQWB.envs.cookiedomain),t.put("cookie","path",QQWB.envs.cookiepath),t.put("cookie","accesstokenname","QQWBToken3"),t.put("cookie","refreshtokenname","QQWBRefreshToken3"),t.put("cookie","refreshtokenexpires",2592e3),t.put("cookie","getAccesstokenName",function(){return[t.get("cookie","accesstokenname"),t.get("base","appkey")].join("_")}),t.put("cookie","getRefreshtokenName",function(){return[t.get("cookie","refreshtokenname"),t.get("base","appkey")].join("_")}),t.put("cookie","defaultEncoder",function(e){return escape(e)}),t.put("cookie","defaultDecoder",function(e){return unescape(e)}),t.put("nativeevent","userloggedin","UserLoggedIn"),t.put("nativeevent","userloginfailed","UserLoginFailed"),t.put("nativeevent","userloggedout","UserLoggedOut"),t.put("nativeevent","tokenready","tokenReady"),t.put("nativeevent","documentready","documentReady"),t.put("nativeevent","everythingready","everythingReady"),t.put("nativeevent","ready","ready"),t.put("solution","deferred",e.deferred.deferred()),t.put("solution","jscallbackname","onFlashReady_a1f5b4ce"),t.put("api","count",0),t.put("ping","urlbase","http://btrace.qq.com/collect"),t.put("ping","paramorder",["ftime","sIp","iQQ","sBiz","sOp","iSta","iTy","iFlow"]),t.put("ping","paramsep",";"),t.put("io","timeout",15e3),t.put("openjs","asynccallbackfunctionname","onOpenjsLoad"),t.put("boot","booting",!1),t.get("innerauth","enabled")&&(n.info("enter inner auth model, set domain to "+t.get("innerauth","rootdomain")),document.domain=t.get("innerauth","rootdomain")),QQWB.provide("init",function(e){function b(e){var t=/.*(?=\/.*$)/,n=/^\/[^\/]/,r=/^http/,i=/^\/\//,s=document.location,o=s.host,u=s.protocol.replace(":","")+":",a;return i.test(e)||r.test(e)?a="":n.test(e)?a=u+o+"/":(a=document.location.href,a=a.match(t),a=(a?a[0]:".")+"/"),i.test(e)&&(e=u+e),a+w(e)}function w(e,t){e=e.replace(/\\/g,"/").replace(/\/\//g,"/").replace(/:\//,"://").replace(/(^|[^\.])(\.\/)/g,"$1");do t=e,e=e.replace(/([\w,\-]*[\/]{1,})([\.]{2,}\/)/g,"");while(t!==e);return e}var t=QQWB,n=t.bigtable,r=t.ping,i=t.log,s=t.String,u=t._token,a=t.dom,f="base",l=n.get("boot","booting"),c=n.get("innerauth","enabled"),h=location.href.match(/oauth2atoken=([^&]+)/i),p,d,v,m,g,y;l||(n.put("boot","booting",!0),n.get("boot","solution")());if(n.get(f,"inited")===!0){i.warning("already initialized");return}e.callbackurl&&(e.callbackurl=b(e.callbackurl)),i.debug("init signal has arrived"),e=t.extend({callbackurl:document.location.href.replace(location.hash,""),pingback:!0,autoclose:!0,samewindow:!1,showappinfo:!0},e,!0),n.put(f,"pingback",e.pingback),n.put(f,"autoclose",e.autoclose),n.put(f,"samewindow",e.samewindow);if(typeof e.appkey=="undefined"){i.critical("client id(appkey) is NOT optional");return}i.info("client id(appkey) is "+e.appkey),n.put("base","appkey",e.appkey),h&&(i.info("resolve token from url"),p=location.href.match(/name=([^&#]+)/i),d=location.href.match(/nick=([^&#]+)/i),u.resolveResponse(decodeURIComponent(h[1])+(p?"&name="+p[1]:"")+(d?"&nick="+d[1]:""),!1)),g=n.get("boot","tokenready"),v=u.getAccessToken(),m=u.getRefreshToken(),y=document.cookie;if(c){if(/uin=([^;]+)/.test(y)&&/skey=([^;]+)/.test(y)||/luin=([^;]+)/.test(y)&&/lskey=([^;]+)/.test(y))g.lock("start auto login"),n.get("solution","deferred").complete(function(){var t=n.get("solution","frame");t&&t.contentWindow&&t.contentWindow.getToken?t.contentWindow.getToken(n.get("base","appkey"),!e.showappinfo).success(function(e){u.resolveResponse(e,!1)}).error(function(e,t,n,r){i.error(["auto login failed,",e,", ",t,", ",s.trim(r)].join(""))}).complete(function(){g.unlock("done auto login")}):(i.error("retrieve inner auth token error, proxy frame not loaded"),g.unlock("failed to load innerauth proxy frame, auto login failed"))})}else i.info("client proxy uri is "+e.callbackurl),n.put("uri","redirect",e.callbackurl),m&&!v&&(g.lock("exchange token"),i.info("exchanging refresh token to access token..."),u.exchangeForToken(function(e){g.unlock("token exchanged")}));return g.unlock("init is called"),r&&e.pingback&&o.indexOf("https")!==0&&r.pingInit(),function(){function s(){var o=u.getAccessToken()&&u.getRefreshToken(),a;i&&(t.info("cancel the **OLD** maintain token schedule"),clearTimeout(i)),o?(a=parseInt(n.get(r.get("cookie","getAccesstokenName")()).split("|")[2],10)-e.time.now()-15e3,t.info("scheduled to exchange token after "+a+"ms"),i=setTimeout(function(){u.exchangeForToken(function(){s()})},a)):i&&(t.info("cancel the exchange token schedule"),clearTimeout(i))}var e=QQWB,t=e.log,n=e.cookie,r=e.bigtable,i;e.bind(r.get("nativeevent","tokenready"),s),e.bind(r.get("nativeevent","userloggedin"),s),e.bind(r.get("nativeevent","userloginfailed"),s),e.bind(r.get("nativeevent","userloggedout"),s)}(),n.put(f,"inited",!0),t})}(),function(){var e=QQWB,t=e.bigtable,n=e.String,r=e.queryString,i=e.log,s=e.Object,o=e.time,u=t.get("io","timeout"),a,f,l,c,h=0,p,d,v,m,g;v=function(){return e.Object.create({ajax:e.ajax,jsonp:e.jsonp,script:e.script})},m=function(e,t){return t=t||"unknown",e.data&&(s.isObject(e.data)?e.data=r.encode(e.data):n.isString(e.data)?e.data=n.trim(e.data).replace(/^&+/,""):i.warn("["+t+"] ignored invalid params data "+default_opts.data)),n.trim(e.type).toUpperCase()=="GET"&&(e.url=joinUrlWithData(e.url,e.data)),n.trim(e.type).toUpperCase()=="GET"&&!e.cache&&(e.url=joinUrlWithData(e.url,"nocache=openjs"+QQWB.uid(5))),e},joinUrlWithData=function(e,t){var n=e.lastIndexOf("?"),r;return t?(n==-1?r=[e,"?",t]:n==e.length-1?r=[e,t]:r=[e,"&",t],r.join("")):e},f=function(e){var t;return{send:function(n){var r=o.now(),s=document.head||document.getElementsByTagName("head")[0]||document.documentElement,a=setTimeout(function(){i.error("load script "+e.url+" timeout"),n(599,"timeout",o.now()-r),n=null},u);t=document.createElement("script"),t.async="async",e.charset&&(t.charset=e.charset),t.src=e.url,t.onload=t.onreadystatechange=function(e,i){if(i||!t.readyState||/loaded|complete/.test(t.readyState)){var u;clearTimeout(a),t.onload=t.onreadystatechange=null,s&&t.parentNode&&s.removeChild(t),t=null,n&&(u=o.now()-r,i?n(-1,"aborted",u):n(200,"success",u),n=null)}},t.onerror=function(e){clearTimeout(a),n&&n(500,"server error",o.now()-r),n=null},s.insertBefore(t,s.firstChild)},abort:function(){t&&t.onload(0,1)}}},l=function(t){var n;return{send:function(r){var s=o.now(),a=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP"),f=setTimeout(function(){i.error("ajax timeout, url "+t.url),r(599,"timeout",o.now()-s),r=null},u);t.async||(t.async="async"),t.username?a.open(t.type,t.url,t.async,t.username,t.password):a.open(t.type,t.url,t.async);try{t.type.toUpperCase()=="POST"&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.setRequestHeader("X-Requested-With","XMLHttpRequest"),a.setRequestHeader("X-Requested-From","openjs"+e.version)}catch(l){i.warning("set header error "+l)}a.send(t.data||null),n=function(u,l){var c,h,p,d,v,m;if(n&&(l||a.readyState===4)){n=null;if(l)a.readyState!==4?(clearTimeout(f),a.abort(),r&&r(-1,"aborted",o.now()-s),r=null):i.debug("abort ajax failed, already finish");else{clearTimeout(f),c=a.status,p=a.getAllResponseHeaders()||"",d={},m=a.responseXML,m&&m.documentElement&&(d.xml=m),d.text=a.responseText;try{h=a.statusText}catch(g){h=""}c===1223&&(c=204);try{t.dataType.toLowerCase()=="json"?v=e.JSON.fromString(d.text):t.dataType.toLowerCase()=="xml"?v=d.xml||e.XML.fromString(d.text):v=d.text}catch(y){clearTimeout(f),i.error("caught exception "+[y.type,y.message].join(" ")+" in ioajax"),r(-2,"exception "+y,o.now()-s);return}}r(c,h,o.now()-s,v,d.text,p,t.dataType),r=null}},!t.async||a.readyState===4?n():a.onreadystatechange=n},abort:function(){n&&n(0,1)}}},c=function(e){var n;return{send:function(r){var s=o.now(),a=t.get("solution","flashmovie"),f="as3callbacktkt"+ ++h,l=setTimeout(function(){i.error("flash as3 timeout, url "+e.url),r(599,"timeout",o.now()-s),r=null},u);n=function(t,u){var a,f,c,h,p,d;if(n){n=null,clearTimeout(l);if(u)r&&r(-1,"aborted",o.now()-s),r=null;else{a=this.httpStatus,f=this.httpStatus==200?"ok":"",c="",h={},h.text=this.httpResponseText;try{e.dataType.toLowerCase()=="json"?p=QQWB.JSON.fromString(h.text):e.dataType.toLowerCase()=="xml"?p=QQWB.XML.fromString(h.text):p=h.text}catch(v){clearTimeout(l),i.error("caught exception "+[v.type,v.message].join(" ")+" in ioas3"),r(-2,"exception "+v,o.now()-s);return}}r(a,f,o.now()-s,p,h.text,c,e.dataType),r=null}},t.put("io",f,n),a&&a.httpRequest?a.httpRequest(e.url,e.data,e.type,f):i.critical("flash transportation object error")},abort:function(){n&&n(0,1)}}},window.onFlashRequestComplete_8df046=function(e){var n,r;if(!e.ticket){i.error("ticket doesn't exists in response");return}n=t.get("io",e.ticket),r=e.srcEvent,n.readyState||(n.readyState=0),/httpStatus/i.test(r.type)?(n.httpStatus=r.status,n.readyState++):/error/i.test(r.type)?(n.httpError=r.type,n.readyState++):/complete/i.test(r.type)&&(n.httpResponseText=r.target.data,n.readyState++),n.readyState==2&&(n.call(n),t.del("io",e.ticket))},d=function(e){return function(t,n,r,i,s,o,u){var a,f;t!==200?(t=2e6+Math.abs(t?t:0),e.reject(t,n,r,"")):typeof (a=QQWB.weibo.util.parseRetCode(s))=="number"&&0!==a?(f=QQWB.weibo.util.parseErrorCode(s),t=1e6+a*1e3+500+(f?f:0),e.reject(t,QQWB.weibo.util.getErrorMessage(s),r,s)):e.resolve(t,n,r,i,o,u)}},g=function(e){return function(t,n,r,i,s,o,u){t!==200?e.reject(t,n,r,s):e.resolve(i,r,s)}},QQWB.extend("io",{flashAjax:function(e){var t=QQWB.deferred.deferred(),n={type:"get",dataType:"json"};return QQWB.extend(n,e,!0),c(n).send(d(t)),t.promise()},ajaxWith:function(e,t,n){var r=QQWB,i=r.String,s=QQWB.deferred.deferred(),o={type:"get",dataType:"json",cache:!1};return QQWB.extend(o,e,!0),o.url?(o.type=i.trim(o.type),o=m(o,"script"),o.dataType=i.trim(o.dataType),o.type.toUpperCase()=="GET"&&o.data&&(o.url=joinUrlWithData(o.url,o.data),o.cache||(o.url=joinUrlWithData(o.url,"nocache=openjs"+QQWB.uid(5)))),l(o).send(t(s)),s.promise(n)):(s.reject(-2,"invalid url",0),s.promise(n))},apiAjax:function(e){return QQWB.io.ajaxWith(e,d)},ajax:function(e){return QQWB.io.ajaxWith(e,g,v())},script:function(e){var t=QQWB,n=t.String,r=v(),i=QQWB.deferred.deferred(),s={charset:"utf-8",cache:!0,type:"get"};return QQWB.extend(s,e,!0),s.url?(s=m(s,"script"),f(s).send(function(e,t,n){e!==200?i.reject(e,t,n):i.resolve(e,t,n)}),i.promise(r)):(i.reject(-2,"invalid url",0),i.promise(r))},jsonp:function(e){var t=QQWB,n=t.String,r=v(),s=QQWB.deferred.deferred(),o="jsonp_"+QQWB.uid(5),u=window.callbackName,a,l={dataType:"json",charset:"utf-8",cache:!1,type:"get"};return QQWB.extend(l,e,!0),l.url?(l=m(l,"jsonp"),l.url=joinUrlWithData(l.url,"callback="+o),window[o]=function(e){var t=e;if(n.isString(e))try{l.dataType.toLowerCase()==="json"?t=QQWB.JSON.fromString(e):l.dataType.toLowerCase()==="xml"&&(t=QQWB.XML.fromString(e))}catch(r){i.error("caught exception "+[r.type,r.message].join(" ")+" in jsonp"),s.reject(-2,"exception "+r,a)}s.resolve(t,a),window[o]=u},f(l).send(function(e,t,n){e!==200&&s.reject(e,t,n),a=n}),s.promise(r)):(s.reject(-2,"invalid url",0),s.promise(r))}}),QQWB.ajax=QQWB.io.ajax,QQWB.jsonp=QQWB.io.jsonp,QQWB.script=QQWB.io.script}(),function(){var e={1:"\u53c2\u6570\u9519\u8bef",2:"\u9891\u7387\u53d7\u9650",3:"\u9274\u6743\u5931\u8d25",4:"\u5185\u90e8\u9519\u8bef"},t={4:"\u8fc7\u591a\u810f\u8bdd",5:"\u7981\u6b62\u8bbf\u95ee",6:"\u8bb0\u5f55\u4e0d\u5b58\u5728",8:"\u5185\u5bb9\u8fc7\u957f",9:"\u5185\u5bb9\u5305\u542b\u5783\u573e\u4fe1\u606f",10:"\u53d1\u8868\u592a\u5feb\uff0c\u9891\u7387\u9650\u5236",11:"\u6e90\u6d88\u606f\u4e0d\u5b58\u5728",12:"\u672a\u77e5\u9519\u8bef",13:"\u91cd\u590d\u53d1\u8868"};QQWB.extend("weibo.util",{parseRetCode:function(e){var t=e.match(/"ret":([^\}]+)/i)||e.match(/<ret>([^<]+)<\/ret>/i);return t?parseInt(t[1],10):t},parseErrorCode:function(e){var t=e.match(/"errcode":([^,]+)/i)||e.match(/<errcode>([^<]+)<\/errcode>/);return t?parseInt(t[1],10):t},parseErrorMsg:function(e){var t=e.match(/"msg":"([^"]+)"/)||e.match(/<msg>([^<]+)<\/msg>/);return t?t[1]:t},getErrorMessage:function(n){var r=this,i=[],s=e[this.parseRetCode(n)],o=t[this.parseErrorCode(n)],u=this.parseErrorMsg(n);return s&&i.push(s),o&&i.push(o),u&&i.push(u),i=i.join(","),i||"\u672a\u77e5\u9519\u8bef"},compat:function(e){return!QQWB.String.startsWith(e,"/")&&(e="/"+e),e.toLowerCase()}})}();var JSON;JSON||(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n<s;n+=1)u[n]=str(n,a)||"null";return i=u.length===0?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+o+"]":"["+u.join(",")+"]",gap=o,i}if(rep&&typeof rep=="object"){s=rep.length;for(n=0;n<s;n+=1)typeof rep[n]=="string"&&(r=rep[n],i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i))}else for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i));return i=u.length===0?"{}":gap?"{\n"+gap+u.join(",\n"+gap)+"\n"+o+"}":"{"+u.join(",")+"}",gap=o,i}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(e){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(e){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(e,t,n){var r;gap="",indent="";if(typeof n=="number")for(r=0;r<n;r+=1)indent+=" ";else typeof n=="string"&&(indent=n);rep=t;if(!t||typeof t=="function"||typeof t=="object"&&typeof t.length=="number")return str("",{"":e});throw new Error("JSON.stringify")}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,i=e[t];if(i&&typeof i=="object")for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r=walk(i,n),r!==undefined?i[n]=r:delete i[n]);return reviver.call(e,t,i)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),QQWB.extend("JSON",{fromString:function(e){if(!e||!QQWB.String.isString(e))return{};e=e.replace(/^\s+/,"").replace(/\s+$/,"");if(window.JSON&&window.JSON.parse)e=window.JSON.parse(e);else{if(!/^[\],:{}\s]*$/.test(e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))throw new SyntaxError("Invalid JSON: "+e);e=(new Function("return "+data))()}return e},stringify:function(e){return e?window.JSON.stringify(e):""},toString:function(e){return QQWB.JSON.stringify(e)},parse:function(e){return e?window.JSON.parse(e):{}}},!0),function(){var e=QQWB,t=e.JSON,n=e.Array,r=e.String,i=e.bigtable,s=e.queryString,o=e.log,u=e.io,a,f,l=i.get("innerauth","rootdomain"),c="*",h=i.get("openjs","asynccallbackfunctionname"),p,d;document.domain=l,p=window.parent,d=window!=p,window.getToken=function(e,t){var n=document.cookie.match(/;\sskey=([^;]+)/)||document.cookie.match(/^skey=([^;]+)/)||document.cookie.match(/;\slskey=([^;]+)/)||document.cookie.match(/^lskey=([^;]+)/);return u.ajax({url:i.get("uri","gettokenbypt"),type:"post",data:["appkey=",e,"&version=2.a","&response_type=",t?"token":"check","&seqid=",Math.floor(Math.random()*1e6),"&appfrom=openjs"+T.version,"&g_tk=",n?n[1]:""].join(""),dataType:"text"})},window.apiAjax=function(e,t,n,o){var a={type:r.trim(o.toUpperCase()),url:i.get("uri","api")+e,data:s.encode(t),dataType:r.trim(n.toLowerCase())};return a.type=="GET"&&(a.url+=a.data?"?"+a.data:"",delete a.data),u.apiAjax(a)};if(d){try{f=p.location.href}catch(v){}f?(o.info("[proxy] app running at same origin"),p.QQWB&&p.QQWB.name==="OpenJS"?(o.info("[proxy] openjs detected in app"),p.QQWB.trigger(i.get("innerauth","eventproxyready"))):o.warning("[proxy] openjs not detected in app")):o.info("[proxy] app running at external auth mode"),p&&p.postMessage&&(o.info("[proxy] message proxy is running properly"),p.postMessage("success",c),a=function(e){var r,i,s,u;try{r=t.fromString(e.data)}catch(a){}r&&r.id&&r.data?(i=r.id,s=r.data,u=s[0],s[2].toLowerCase()=="xml"&&(s[2]="_xml_"),u?apiAjax.apply(this,s).complete(function(){p.postMessage(t.stringify({id:i,data:n.fromArguments(arguments)}),c)}):(p.postMessage(t.stringify({id:i,data:[-1,"interface can not be empty"]}),c),o.error("[proxy] interface cant not be empty"))):o.warn("[proxy] ignore unexpected message "+e.data)},window.addEventListener?window.addEventListener("message",a,!1):window.attachEvent&&window.attachEvent("onmessage",a))}}();</script></head><body>
- </body></html>
|