This commit is contained in:
henrydays 2019-03-28 20:59:33 +00:00
parent 1b994bbbee
commit c7c0764170
6 changed files with 30 additions and 21 deletions

View File

@ -81,7 +81,7 @@ class App extends Component {
logged: false,
isModalVisible: false,
state: { text: "" },
username: "ZV4ZWJXTVV",
username: "",
failedAttempt: false,
push: 4,
UI_loginScannerActive: false,
@ -255,18 +255,19 @@ class App extends Component {
underlineColorAndroid="transparent"
onFocus={this._print}
//onFocus={this._print}
maxLength={15}
blurOnSubmit={true}
secureTextEntry={true}
onChangeText={searchString => {
this.setState({ username: searchString });
// secureTextEntry={true}
onChangeText={user => {
this.setState({ username:user });
}}
clearButtonMode="always"
placeholder={this.state.username}
clearTextOnFocus={true}
onSubmitEditing={Keyboard.dismiss}
placeholder={this.state.username}
value={this.state.username}
placeholder="QR code"
/>
<TouchableOpacity onPress={this._scanQr}>

View File

@ -1805,21 +1805,25 @@ export function login(user, pass) {
body: formBody
})
.catch(err => {
console.log(err);
alert("Erro no login!!");
alert("error");
co;
Alert.alert("Erro", "Não foi possível conectar ao servidor. Verifique se possui conexão à internet e tente novamente." );
dispatch({
type: API_LOGIN,
logged: false,
failedAttempt: true,
tokenData: "error",
user: { Name: "" }
loadingLogin: false,
});
})
.catch(err => {
console.log("error");
dispatch({
type: API_LOGIN,
logged: false,
failedAttempt: true,
tokenData: "error",
loadingLogin: false,
});
})
.then(res => res.json())
.then(parsed => {
@ -1865,6 +1869,15 @@ export function login(user, pass) {
userDetails: details
});
}
})
.catch(err=>{
dispatch({
type: API_LOGIN,
logged: false,
failedAttempt: true,
tokenData: "error",
loadingLogin: false,
});
});
};
}

View File

@ -172,13 +172,8 @@ const apiReducer = (state = apiState, action) => {
//token:action.token,
failedAttempt: action.failedAttempt,
user: action.user,
userDetails: {
token: action.token,
username: action.userDetails.username,
password: action.userDetails.password
},
loadingLogin: false,
onHold: action.onHold,
onHold: false,
token: action.token
});

View File

@ -44,7 +44,7 @@
<key>NSCalendarsUsageDescription</key>
<string>Not used, just added this key because i used react-native and needed this keys for approval.</string>
<key>NSCameraUsageDescription</key>
<string>Not used, just added this key because i used react-native and needed this keys for approval.</string>
<string>A camera é usada para ler os QR codes presentes no evento. Facilita o uso da aplicação.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Not used, just added this key because i used react-native and needed this keys for approval.</string>
<key>NSLocationWhenInUseUsageDescription</key>

BIN
api/.DS_Store vendored

Binary file not shown.

BIN
api/wwwroot/.DS_Store vendored

Binary file not shown.