Guest User

Untitled

a guest
Apr 30th, 2018
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. export default {
  2. data () {
  3. return {
  4. model: {
  5. email: '',
  6. password: '',
  7.  
  8. },
  9. modelValidations: {
  10. email: {
  11. required: true,
  12. email: true
  13. },
  14. password: {
  15. required: true,
  16. min: 5
  17. }
  18. },
  19. }
  20. },
  21. methods: {
  22. getError(fieldName) {
  23. return this.errors.first(fieldName)
  24. },
  25. validate() {
  26.  
  27.  
  28. let login = this;
  29. this.$auth.login({
  30. params: {
  31. email: login.model.email,
  32. password: login.model.password
  33. },
  34. success: function (response){
  35. console.log(response);
  36. let id = response.data.userinfo.id;
  37. },
  38. error: function (error) {
  39. console.log(error);
  40. },
  41. // rememberMe: true,
  42. // fetchUser: true,
  43. }).then(function(id) {
  44. if (id ==1) {
  45. this.$router.push('/admindashboard');
  46. } else {
  47. this.$router.push('/clientdashboard');
  48. }
  49. });
  50. }
  51. }
Add Comment
Please, Sign In to add comment