|
iframe增加关闭按钮.txt
- $(".third-login-btn").length && ($(".third-login-btn").unbind(),
- $(".third-login-btn").click(function() {
- $(this).unbind("mouseenter mouseleave");
- var a = {};
- if (a.appid = config.appId,
- a.gameid = "undefined" != typeof config.gameId ? config.gameId : 0,
- a.platform = $(this).data("platform"),
- a.loginfrom = d.loginfrom,
- e.exports.sdkInterface && e.exports.sdkInterface.showSSOLoginView) {
- var i = "";
- if ("WEIXIN_WEB_GC" == a.platform && (i = "weixin"),
- "" !== i)
- return void o.showSSOLoginView(i)
- }
- t.browser().isWeixin() && "WEIXIN_WEB_GC" == a.platform && (a.platform = "WEIXIN_PUB"),
- t.ajaxServerData("user/thirdlogin", a, function(e) {
- if (0 == e.code) {
- if (t.setLocalData(t.localKey.urlReferrer, self.location.href),
- "WEIXIN_PUB" == a.platform)
- return void (window.location.href = e.data.redirectUrl);
- $("#third-app-authorize-page").length > 0 && $("#third-app-authorize-page").remove();
- var i = "";
- i += '<div id="third-app-authorize-page">',
- i += '<iframe id="authorize-page" frameborder="0" src="' + e.data.redirectUrl + '"></iframe>',
- i += '<div class="h5center-footer-close toggle-footer-close close"><div>关闭</div></div>',
- i += "</div>",
- $("body").append(i),
- $("#third-app-authorize-page .close").on("click", function() {
- $("#third-app-authorize-page").remove()
- }
- )
- } else
- p(e.message)
- }
- )
- }
- ))
复制代码
|
|