WT 1.1.14 SSL

This commit is contained in:
bossanyit
2021-05-13 16:02:54 +02:00
parent e20ec5c222
commit 8048a74a50
8 changed files with 163 additions and 24 deletions
+10 -8
View File
@@ -104,7 +104,9 @@ class Cache with Logging {
static final String activeExercisePlanDateKey = "active_exercise_plan_date";
static final String activeExercisePlanDetailsKey = "active_exercise_details_plan";
static String baseUrl = 'http://aitrainer.info:8888/api/';
static String baseUrlLive = 'https://aitrainer.info:8943/api/';
static String baseUrlTest = 'https://aitrainer.info:8843/api/';
late String baseUrl;
static final String mediaUrl = 'https://aitrainer.info:4343/media/';
static final String username = 'bosi';
static final String password = 'andio2009';
@@ -171,7 +173,7 @@ class Cache with Logging {
String testEnv = EnvironmentConfig.test_env;
this.testEnvironment = testEnv;
if (testEnv == "1") {
baseUrl = 'http://aitrainer.app:8899/api/';
baseUrl = baseUrlTest;
liveServer = false;
}
@@ -181,7 +183,7 @@ class Cache with Logging {
}
void setTestBaseUrl() {
baseUrl = 'http://aitrainer.app:8899/api/';
baseUrl = baseUrlTest;
}
String getAuthToken() {
@@ -288,22 +290,22 @@ class Cache with Logging {
void setServerAddress(SharedPreferences prefs) {
if (this.testEnvironment == "1") {
baseUrl = 'http://aitrainer.app:8899/api/';
baseUrl = baseUrlTest;
print("TestEnv $baseUrl");
return;
}
final bool? live = prefs.getBool(Cache.serverKey);
if (live == null) {
baseUrl = 'http://aitrainer.app:8888/api/';
baseUrl = baseUrlLive;
print("Live Env $baseUrl");
liveServer = true;
return;
}
liveServer = live;
if (live) {
baseUrl = 'http://aitrainer.info:8888/api/';
baseUrl = baseUrlLive;
} else {
baseUrl = 'http://aitrainer.app:8899/api/';
baseUrl = baseUrlTest;
}
print("Env $baseUrl");
@@ -331,7 +333,7 @@ class Cache with Logging {
return prefs.getString(authTokenKey);
}
static String getBaseUrl() {
String getBaseUrl() {
return baseUrl;
}