|
@@ -24,6 +24,20 @@ export function getOrgCode() {
|
|
|
return domain;
|
|
|
}
|
|
|
|
|
|
+export function getOrgCodeFromDomain(domain: string) {
|
|
|
+ let code = '';
|
|
|
+ if (!domain) return '';
|
|
|
+ console.log('domain', domain);
|
|
|
+
|
|
|
+ const hostname = domain.split('://')[1];
|
|
|
+ if (!hostname) return '';
|
|
|
+
|
|
|
+ const ipFormat = new RegExp(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/);
|
|
|
+ if (ipFormat.test(hostname) || hostname.includes('localhost')) return '';
|
|
|
+ code = hostname.split('.')[0];
|
|
|
+ return code;
|
|
|
+}
|
|
|
+
|
|
|
export const PLATFORM = 'WEB';
|
|
|
|
|
|
if (!localStorage.getItem('deviceId')) {
|