(() => { // Relative URL (ex: /dashboard) if (REMOTE_URL[0] === '/') { return (window.location.origin + REMOTE_URL).replace(/\/$/, ''); } return REMOTE_URL.replace(/\/$/, ''); })()
(() => { if (window.location.port === '4000') { return 'http://localhost:4000/admin'; } // Relative URL (ex: /dashboard) if (process.env.REMOTE_URL[0] === '/') { return (window.location.origin + process.env.REMOTE_URL).replace(/\/$/, ''); } return process.env.REMOTE_URL.replace(/\/$/, ''); })()
self.$http.get(window.location.origin + '/imagebox?type=rev-64&data=' + data) .then(response => { if (response.data.code === 200) { IMG_MAP.set(uri, response.data.data.url) callback(response.data.data.url) } else { console.log(response.data.message) } }) .catch(err => { console.log(err) })
function pageLocationOrigin() { // location.origin normally returns the protocol + domain + port (eg. https://example.com:8080) // but for file:// protocol this is browser dependant and in particular Firefox returns "null" // in this case. if (location.protocol === 'file:') { return 'file://'; } else { return location.origin; } }
const MagicLink = ({ registrationToken }) => { const { formatMessage } = useIntl(); const handleCopy = () => { strapi.notification.info('notification.link-copied'); }; const link = `${window.location.origin}${basename}auth/register?registrationToken=${registrationToken}`; return ( <Wrapper> <IconWrapper> <Envelope /> </IconWrapper> <Flex flexDirection="column" justifyContent="center"> <Text fontWeight="semiBold" color="black" fontSize="md" lineHeight="18px"> {link} <CopyToClipboard onCopy={handleCopy} text={link}> <Duplicate fill="#8B91A0" className="icon-duplicate" /> </CopyToClipboard> </Text> <Text fontWeight="regular" color="grey" fontSize="sm" lineHeight="18px"> {formatMessage({ id: 'app.components.Users.MagicLink.connect' })} </Text> </Flex> </Wrapper> ); }
constructor(session) { this.session = session; this.localApiUrl = config.localApiUrl || window.location.origin; }
(() => { // Relative URL (ex: /dashboard) if (REMOTE_URL[0] === '/') { return (window.location.origin + REMOTE_URL).replace(/\/$/, ''); } return REMOTE_URL.replace(/\/$/, ''); })()
(() => { if (window.location.port === '4000') { return 'http://localhost:4000/admin'; } // Relative URL (ex: /dashboard) if (process.env.REMOTE_URL[0] === '/') { return (window.location.origin + process.env.REMOTE_URL).replace(/\/$/, ''); } return process.env.REMOTE_URL.replace(/\/$/, ''); })()
constructor(session) { this.session = session; this.localApiUrl = config.localApiUrl || window.location.origin; }
const MagicLink = ({ registrationToken }) => { const { formatMessage } = useIntl(); const handleCopy = () => { strapi.notification.info('notification.link-copied'); }; const link = `${window.location.origin}${basename}auth/register?registrationToken=${registrationToken}`; return ( <Wrapper> <IconWrapper> <Envelope /> </IconWrapper> <Flex flexDirection="column" justifyContent="center"> <Text fontWeight="semiBold" color="black" fontSize="md" lineHeight="18px"> {link} <CopyToClipboard onCopy={handleCopy} text={link}> <Duplicate fill="#8B91A0" className="icon-duplicate" /> </CopyToClipboard> </Text> <Text fontWeight="regular" color="grey" fontSize="sm" lineHeight="18px"> {formatMessage({ id: 'app.components.Users.MagicLink.connect' })} </Text> </Flex> </Wrapper> ); }