import { useGlobSetting } from '@/hooks/setting'; const { loginApp, cbrainLoginApp, cbrainLoginClientId } = useGlobSetting(); export const getRedirectUrl = () => { const encodeUrl = encodeURIComponent(window.location.href); return loginApp + '?redirect=' + encodeUrl; }; export const getLogoutUrl = () => { if (!loginApp) return ''; const encodeUrl = encodeURIComponent(location.pathname); return loginApp + `logout?redirect=${encodeUrl}`; }; export const getCBrainRedirectUrl = (path?: string) => { const encodeUrl = encodeURIComponent(path || window.location.href); return cbrainLoginApp + '&client_id=' + cbrainLoginClientId + '&redirect_uri=' + encodeUrl; };