|
|
|
@ -29,29 +29,24 @@ export class DomainResolver { |
|
|
|
|
|
|
|
|
|
const parts = url.match(/http:\/\/.*?\.(.*?)\..*?/) || [] |
|
|
|
|
const nickname = parts[1] || null |
|
|
|
|
const isPlacetgroup = url.indexOf('laen') > -1 || |
|
|
|
|
url.indexOf('smsmoney') > -1 || |
|
|
|
|
url.indexOf('smsraha') > -1 || |
|
|
|
|
url.indexOf('placetgroup') > -1 |
|
|
|
|
|
|
|
|
|
const isNordecum = url.indexOf('smspinigai') > -1 || |
|
|
|
|
url.indexOf('paskolos') > -1 || |
|
|
|
|
url.indexOf('nordecum') > -1 |
|
|
|
|
|
|
|
|
|
if (!isPlacetgroup && !isNordecum) { |
|
|
|
|
const project = isNordecum ? 'nordecum' : 'placetgroup' |
|
|
|
|
const tld = isNordecum ? 'lt' : 'com' |
|
|
|
|
const isLocal = url.indexOf('.sv') !== -1 |
|
|
|
|
|
|
|
|
|
if (isLocal && !nickname) { |
|
|
|
|
return null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const project = isPlacetgroup ? 'placetgroup' : 'nordecum' |
|
|
|
|
const tld = isPlacetgroup ? 'com' : 'lt' |
|
|
|
|
const isLocal = url.indexOf('.sv') !== -1 |
|
|
|
|
if (nickname && isLocal) { |
|
|
|
|
url = project + '.' + nickname + '.sv' |
|
|
|
|
} else { |
|
|
|
|
url = 'dev.' + project + '.' + tld |
|
|
|
|
} |
|
|
|
|
url = (isLocal ? 'http://' : 'https://') + url |
|
|
|
|
console.log('domain_resolver', parts, nickname, isPlacetgroup, project, tld, url) |
|
|
|
|
url = isLocal |
|
|
|
|
? 'http://' + project + '.' + nickname + '.sv' |
|
|
|
|
: 'https://dev.' + project + '.' + tld |
|
|
|
|
|
|
|
|
|
console.log('domain_resolver', parts, nickname, isNordecum, project, tld, url) |
|
|
|
|
return url |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|