change api server

This commit is contained in:
Patrick Nagurny
2018-11-08 16:57:10 -05:00
parent 0f6a5fc95f
commit 8a86ad060a
2 changed files with 5 additions and 5 deletions

View File

@@ -44,12 +44,12 @@ export class SessionService {
this.loading = true; this.loading = true;
let server = this.configService.get('server'); let server = this.configService.get('server');
if(!server) { if(!server || server === 'https://openaccounting.io:8080/api') {
server = 'https://openaccounting.io:8080/api'; server = 'https://api.openaccounting.io';
this.configService.put('server', server); this.configService.put('server', server);
} }
this.apiService.setUrl(server || 'https://openaccounting.io:8080/api'); this.apiService.setUrl(server);
sessionId = sessionId || this.configService.get('sessionId'); sessionId = sessionId || this.configService.get('sessionId');
@@ -104,7 +104,7 @@ export class SessionService {
} }
// initialize websocket // initialize websocket
let matches = server.match(/\/\/(.+?)\//); let matches = server.match(/\/\/([^\/]+)/);
if(matches[1]) { if(matches[1]) {
let url = 'wss://' + let url = 'wss://' +

View File

@@ -5,7 +5,7 @@ export class Config {
defaultOrg: string; defaultOrg: string;
reportData: any; reportData: any;
constructor(options: any = {}) { constructor(options: any = {}) {
this.server = options.server || 'https://openaccounting.io:8080/api'; this.server = options.server || 'https://api.openaccounting.io';
this.email = options.email; this.email = options.email;
this.password = options.password; this.password = options.password;
this.defaultOrg = options.defaultOrg; this.defaultOrg = options.defaultOrg;