此刻,我把手Ember.js無效的路線是這樣的:如何處理無效的路由沒有斜槓Ember.js
this.route('invalid', { path: '*path' }
這工作,並適用於類似的路線:
https://www.appname.com/#/misspelled_name
但是,使用Dropbox Datastores API時,我遇到了一些問題。認證請求後,Dropbox重定向到:
https://www.appname.com/#access_token=...
有沒有辦法處理這條路線?路線名稱前沒有斜槓?在這種情況下,「無效」路線未應用,並且收到錯誤「路線access_token = ...未找到」。我應該如何在Ember中處理這個響應?
UPDATE
我不認爲這是可能的處理這個問題。對我來說唯一的工作解決方案是在Ember被加載之前進行身份驗證。認證成功後,我打開我的燼的應用程序:
window.dropboxClient = new Dropbox.Client({
key: 'some_key'
});
dropboxClient.authenticate({ interactive: true }, function(error) {
if (error) {
return console.log('Error during authentication');
}
});
yepnope([{
test : window.dropboxClient.isAuthenticated(),
yep : ['my-ember-app.js']
}])
你有沒有解決過這個問題?我有'#_ = _'的Facebook身份驗證重定向網址的問題。 – Spundun