2013-10-23 42 views
0

我想顯示一個像Facebook登錄和成功登錄的彈出窗口,我想關閉該彈出窗口並重定向到原始窗口。Facebook喜歡彈出窗口自定義oAuth

我用我定製的OAuth,但我想用它像Facebook登錄

我使用煎茶觸摸,當我打開使用window.open窗口的新全屏窗口打開並在成功登錄重定向頁面僅在新的彈出窗口中打開。

enter image description here

回答

0

你爲什麼不使用類似的浮動容器的iframe

Ext.define('MyApp.view.oAuthContainer', { 
    extend: 'Ext.Container', 

    config: { 
     centered: true, 
     height: 300, 
     width: 400, 
     hideOnMaskTap: false, 
     modal: true, 
     html: '<iframe src="https://myOAuthLoginService onLoad="MyApp.app.getController("MyController").myMethodToHandleAniFrameRedirect(this);"></iframe>"', 
     items: [{ 
      xtype: 'toolbar', 
      docked: 'top', 
      items: [{ 
       xtype: 'spacer' 
      }, { 
       xtype: 'button', 
       handler: function(button, event) { 
        button.up("container").hide({type: 'fade', out: true}); 
       }, 
       iconCls: 'delete' 
      }] 
     }] 
    } 
}); 

然後,所有你必須做的就是創建一個名爲與myController的一個名爲myMethodToHandleAniFrameRedirect(iframe的方法控制)在成功登錄oauth時處理iframe重定向。您可以從方法中的iframe對象中獲取url以確保身份驗證成功。

+0

我試過你的方法,但仍然頁面獲取重定向在iframe本身,而不是父窗口 – Hunt