私のアプリにログインするための認証を作成していますが、これらの3つの問題があり、進める方法がわかりません。問題を解決する方法について多くのことを知らない、私はまだそれを学んでいる、私のアプリケーションは、もはや画面が空白だけになって表示されませんこのプロセスを実行した後、チュートリアルは、ember簡単な認証のです:http://ember-simple-auth.com/ - :'ApplicationRouteMix'が定義されていますが使用されていません[Ember.js]
Could not start watchman
Visit https://ember-cli.com/user-guide/#watchman for more info.
Livereload server on http://localhost:49153
'instrument' is imported from external module 'ember-data/-debug' but
never used
/home/carlos/www/vendasapi-frontend/app/controllers/login.js
4:31 error 'session' is not defined no-undef
✖ 1 problem (1 error, 0 warnings)
/home/carlos/www/vendasapi-frontend/app/routes/application.js
2:8 error 'ApplicationRouteMix' is defined but never used no-
unused-vars
5:35 error 'ApplicationRouteMixin' is not defined no-undef
✖ 2 problems (2 errors, 0 warnings)
Build successful (4688ms) – Serving on http://localhost:4200/
Slowest Nodes (totalTime => 5%) | Total (avg)
----------------------------------------------+---------------------
Babel (20) | 1481ms (74 ms)
Rollup (1) | 1352ms
EslintValidationFilter (2) | 703ms (351 ms)
Concat (8) | 545ms (68 ms)
アプリ/コントローラ/ login.js
import Ember from 'ember';
export default Ember.Controller.extend({
session: Ember.inject.service(session),
actions: {
authenticate() {
let { identification, password } =
this.getProperties('identification', 'password');
this.get('session').authenticate('authenticator:oauth2',
identification, password).catch((reason) => {
this.set('errorMessage', reason.error);
});
}
}
});
アプリ/コントローラ/
import Ember from 'ember';
export default Ember.Controller.extend({
session: Ember.inject.service('session'),
actions: {
logout() {
this.get('session').invalidate();
}
}
});
アプリ/路線/
import Ember from 'ember';
import ApplicationRouteMix from
'ember-simple-auth/mixins/application-route-mixin';
export default Ember.Route.extend(ApplicationRouteMixin);
はすべての問題を解決し、私のアプリが再び働いている、感謝の男!! – Techtique