heheer 3b82ed0aa1
feat: support sub route config (#3071)
* feat: support sub route config

* dockerfile

* fix upload

* delete unused code
2024-11-07 13:53:23 +08:00

21 lines
558 B
TypeScript

import FingerprintJS from '@fingerprintjs/fingerprintjs';
export const getUserFingerprint = async () => {
const fp = await FingerprintJS.load();
const result = await fp.get();
console.log(result.visitorId);
};
export const hasHttps = () => {
return window.location.protocol === 'https:';
};
export const getWebReqUrl = (url: string = '') => {
if (!url) return '/';
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL;
if (!baseUrl) return url;
if (!url.startsWith('/') || url.startsWith(baseUrl)) return url;
return `${baseUrl}${url}`;
};