LoginController.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Ext.define('saas.view.auth.LoginController', {
  2. extend: 'Ext.app.ViewController',
  3. alias: 'controller.login',
  4. init: function() {
  5. this.callParent(arguments);
  6. },
  7. onLoginButton: function() {
  8. // var me = this,
  9. // form = me.lookup('authdialog'),
  10. // values = form.getValues();
  11. // me.getView().setMasked(true);
  12. // saas.model.Session.login(values.username, values.password)
  13. // .then(function(session) {
  14. // me.fireEvent('login', session);
  15. // })
  16. // .catch(function(error) {
  17. // Ext.toast(error);
  18. // })
  19. // .then(function(session) {
  20. // me.getView().setMasked(false);
  21. // });
  22. this.fireEvent('login', new saas.model.Session({
  23. token: 'XXXXXX',
  24. expires: 180000,
  25. timestamp: new Date().getTime(),
  26. account: new saas.model.Account({
  27. username: 'XXXXXX',
  28. realname: '张三',
  29. email: 'zhangs@gmail.com',
  30. mobile: '15812345678'
  31. })
  32. }));
  33. },
  34. onWeixinLogin : function() {
  35. },
  36. onNewAccount: function() {
  37. }
  38. });