Commit 784ed0a550a5018065466d15238fc0cb1095454f
1 parent
8ec897f0
Exists in
master
and in
2 other branches
Finished login integration connected to juventude.org.br
Showing
3 changed files
with
13 additions
and
18 deletions
Show diff stats
ConfJuvApp/config.xml
1 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
2 | 2 | <widget id="com.ionicframework.confjuvapp748431" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> |
3 | 3 | <name>ConfJuvApp</name> |
4 | - <description> | |
5 | - An Ionic Framework and Cordova project. | |
6 | - </description> | |
7 | - <author email="hi@ionicframework" href="http://ionicframework.com/"> | |
8 | - Ionic Framework Team | |
9 | - </author> | |
4 | + <description>Aplicativo móvel para 3ª Conferência Nacional de Juventude</description> | |
5 | + <author email="contato@juventude.gov.br" href="http://www.juventude.gov.br/"></author> | |
10 | 6 | <content src="index.html"/> |
11 | 7 | <access origin="*"/> |
8 | + <allow-navigation href="*" /> | |
9 | + <allow-intent href="*" /> | |
12 | 10 | <preference name="webviewbounce" value="false"/> |
13 | 11 | <preference name="UIWebViewBounce" value="false"/> |
14 | 12 | <preference name="DisallowOverscroll" value="true"/> |
... | ... | @@ -38,4 +36,4 @@ |
38 | 36 | <splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/> |
39 | 37 | <splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/> |
40 | 38 | </platform> |
41 | -</widget> | |
42 | 39 | \ No newline at end of file |
40 | +</widget> | ... | ... |
ConfJuvApp/www/index.html
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <meta charset="utf-8"> |
5 | 5 | <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> |
6 | 6 | |
7 | - <title>3ª Conferência Nacional de Juventude</title> | |
7 | + <title>ConfJuvApp</title> | |
8 | 8 | |
9 | 9 | <!-- CSS --> |
10 | 10 | <link href="lib/ionic/css/ionic.css" rel="stylesheet"> | ... | ... |
ConfJuvApp/www/js/controllers.js
... | ... | @@ -46,25 +46,22 @@ angular.module('confjuvapp.controllers', []) |
46 | 46 | |
47 | 47 | $scope.loading = true; |
48 | 48 | |
49 | - var req = { | |
50 | - method: 'POST', | |
51 | - url: ConfJuvAppUtils.pathTo('login'), | |
49 | + var config = { | |
52 | 50 | headers: { |
53 | - 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' | |
51 | + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', | |
54 | 52 | }, |
55 | - data: jQuery.param(data) | |
53 | + timeout: 10000 | |
56 | 54 | } |
57 | 55 | |
58 | - $http(req) | |
59 | - .success(function(data, status, headers, config) { | |
56 | + $http.post(ConfJuvAppUtils.pathTo('login'), jQuery.param(data), config) | |
57 | + .then(function(resp) { | |
60 | 58 | $scope.closeModal(); |
61 | 59 | $ionicPopup.alert({ title: 'Login', template: 'Login efetuado com sucesso!' }); |
62 | 60 | ConfJuvAppUtils.loggedIn = true; |
63 | 61 | $scope.loading = false; |
64 | - }) | |
65 | - .error(function(data, status, headers, config) { | |
62 | + }, function(err) { | |
66 | 63 | $scope.closeModal(); |
67 | - var popup = $ionicPopup.alert({ title: 'Login', template: 'Erro ao efetuar login, por favor tente novamente.' }); | |
64 | + var popup = $ionicPopup.alert({ title: 'Login', template: 'Erro ao efetuar login. Verifique usuário e senha e conexão com a internet.' }); | |
68 | 65 | ConfJuvAppUtils.loggedIn = false; |
69 | 66 | $scope.loading = false; |
70 | 67 | popup.then(function() { | ... | ... |