session management update

merge-requests/994/merge
Elham Rababh 4 years ago
parent e242aa19bc
commit c30d6bebd8

@ -40,11 +40,17 @@ class BaseAppClient {
try {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
// String doctorID = await sharedPref.getString(DOCTOR_ID);
// if(doctorID != null)
// body['DoctorID'] = int.parse(doctorID);
if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null)
if (body['DoctorID'] == null) {
body['DoctorID'] = doctorProfile?.doctorID;
if (body['DoctorID'] == "") body['DoctorID'] = null;
}
if (body['DoctorID'] == "")
body['DoctorID'] = null;
if (body['EditedBy'] == null)
body['EditedBy'] = doctorProfile?.doctorID;
if (body['ProjectID'] == null) {
@ -63,7 +69,6 @@ class BaseAppClient {
if (body['TokenID'] == null) {
body['TokenID'] = token ?? '';
}
// body['TokenID'] = "@dm!n" ?? '';
if (!isFallLanguage) {
String lang = await sharedPref.getString(APP_Language);
@ -73,7 +78,6 @@ class BaseAppClient {
body['LanguageID'] = 2;
}
body['stamp'] = DateTime.now().toIso8601String();
// if(!body.containsKey("IPAdress"))
body['IPAdress'] = IP_ADDRESS;
if (body['VersionID'] == null) {
body['VersionID'] = VERSION_ID;

@ -434,7 +434,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 6.7;
const VERSION_ID = 8.3;
const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true;

@ -142,7 +142,6 @@ class AuthenticationService extends BaseService {
Future insertDeviceImei(InsertIMEIDetailsModel insertIMEIDetailsModel) async {
hasError = false;
// insertIMEIDetailsModel.tokenID = "@dm!n";
_insertDeviceImeiRes = {};
try {
await baseAppClient.post(INSERT_DEVICE_IMEI,

@ -102,9 +102,9 @@ class AuthenticationViewModel extends BaseViewModel {
insertIMEIDetailsModel.titleDescriptionN =
profileInfo['Title_DescriptionN'];
insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID);
insertIMEIDetailsModel.doctorID = loggedIn != null
? loggedIn['List_MemberInformation'][0]['MemberID']
: user.doctorID;
// insertIMEIDetailsModel.doctorID = loggedIn != null
// ? loggedIn['List_MemberInformation'][0]['MemberID']
// : user.doctorID;
insertIMEIDetailsModel.outSA =
loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA;
insertIMEIDetailsModel.vidaAuthTokenID =
@ -174,6 +174,7 @@ class AuthenticationViewModel extends BaseViewModel {
loginDoctorID: loggedUser.listMemberInformation[0].employeeID,
otpSendType: authMethodType.getTypeIdService().toString(),
);
await sharedPref.setString(DOCTOR_ID, (loggedUser.listMemberInformation[0].employeeID).toString());
await _authService.sendActivationCodeForDoctorApp(activationCodeModel);
if (_authService.hasError) {
error = _authService.error;
@ -189,6 +190,7 @@ class AuthenticationViewModel extends BaseViewModel {
Future checkActivationCodeForDoctorApp(
{String activationCode, bool isSilentLogin = false}) async {
setState(ViewState.BusyLocal);
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp =
new CheckActivationCodeRequestModel(
zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode,
@ -208,9 +210,7 @@ class AuthenticationViewModel extends BaseViewModel {
: user.projectID.toString(),
oTPSendType: await sharedPref.getInt(OTP_TYPE),
iMEI: localToken,
loginDoctorID: userInfo.userID != null
? int.parse(userInfo.userID)
: user.editedBy,
loginDoctorID: loggedUser.listMemberInformation[0].employeeID,
// loggedUser.listMemberInformation[0].employeeID,
isForSilentLogin: isSilentLogin,
generalid: "Cs2020@2016\$2958");

@ -59,7 +59,8 @@ class DashboardViewModel extends BaseViewModel {
_firebaseMessaging.getToken().then((String token) async {
if (token != '') {
// DEVICE_TOKEN = token;
authProvider.insertDeviceImei(token);
///TODO Elham* return back
// authProvider.insertDeviceImei(token);
}
});
}

Loading…
Cancel
Save